summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3ae64df)
raw | patch | inline | side by side (parent: 3ae64df)
author | Josef Weidendorfer <Josef.Weidendorfer@gmx.de> | |
Sun, 27 Nov 2005 21:04:14 +0000 (22:04 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 27 Nov 2005 22:40:28 +0000 (14:40 -0800) |
When doing multiple renames, and a rename in the middle fails,
git-mv did not store the successful renames in the git index;
this is fixed by delaying the error message on a failed rename
to after the git updating.
Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-mv did not store the successful renames in the git index;
this is fixed by delaying the error message on a failed rename
to after the git updating.
Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-mv.perl | patch | blob | history |
diff --git a/git-mv.perl b/git-mv.perl
index 990bec50343a337c90d269e3b860cc82fad414e3..ac19876fecbd2758e2782ae3f3423a727a036bd3 100755 (executable)
--- a/git-mv.perl
+++ b/git-mv.perl
# Final pass: rename/move
my (@deletedfiles,@addedfiles,@changedfiles);
+$bad = "";
while(scalar @srcs > 0) {
$src = shift @srcs;
$dst = shift @dsts;
if ($opt_n || $opt_v) { print "Renaming $src to $dst\n"; }
if (!$opt_n) {
- rename($src,$dst)
- or die "rename failed: $!";
+ if (!rename($src,$dst)) {
+ $bad = "renaming '$src' failed: $!";
+ last;
+ }
}
$safesrc = quotemeta($src);
close(H);
}
}
+
+if ($bad ne "") {
+ print "Error: $bad\n";
+ exit(1);
+}