[PATCH] Make git-mv work in subdirectories, too
Turns out, all git programs git-mv uses are capable of operating in a subdirectory just fine. So don't complain about it. [jc: I think that sounds sane. You need to grab the exit status from `git-rev-parse --git-dir`, which I added. Alex Riesen says this worked fine.] Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Johannes Schindelin committed
Nov 25, 2005 at 18:45 UTC
4518bb88392fcd44bacae640754e7326a8fdf477
1 file changed
+3
-9
git-mv.perl
+3
-9
@@ -19,15 +19,9 @@ EOT
19
exit(1);
20
}
21
22
-# Sanity checks:
23
-my $GIT_DIR = $ENV{'GIT_DIR'} || ".git";
24
-
25
-unless ( -d $GIT_DIR && -d $GIT_DIR . "/objects" &&
26
- -d $GIT_DIR . "/objects/" && -d $GIT_DIR . "/refs") {
27
- print "Error: git repository not found.";
28
- exit(1);
29
-}
30
-
22
+my $GIT_DIR = `git rev-parse --git-dir`;
23
+exit 1 if $?; # rev-parse would have given "not a git dir" message.
24
+chomp($GIT_DIR);
25
26
our ($opt_n, $opt_f, $opt_h, $opt_k, $opt_v);
27
getopts("hnfkv") || usage;