]> asedeno.scripts.mit.edu Git - git.git/blobdiff - git-svn.perl
receive-pack: check object type of sha1 before using them as commits
[git.git] / git-svn.perl
index 41fedf5979da140bd329b11d47bd8a2c53335ee2..c51f1e7391348b1d063a505ce41e5988888bae2d 100755 (executable)
@@ -197,8 +197,8 @@ for (my $i = 0; $i < @ARGV; $i++) {
        }
 };
 
-# make sure we're always running
-unless ($cmd =~ /(?:clone|init|multi-init)$/) {
+# make sure we're always running at the top-level working directory
+unless ($cmd && $cmd =~ /(?:clone|init|multi-init)$/) {
        unless (-d $ENV{GIT_DIR}) {
                if ($git_dir_user_set) {
                        die "GIT_DIR=$ENV{GIT_DIR} explicitly set, ",