threads / patch / 2692

patchgit-mv: follow -k request even on failing renames

Subject: [PATCH] git-mv: follow -k request even on failing renames

## tl;dr

One message between Nov 27, 2005 and Nov 27, 2005. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Josef Weidendorfer· Nov 27, 2005, 21:11 UTC · lore

-k requests to keep running on an error condition. Previously, git-mv stopped on failing renames even with -k.

There are some error conditions which are not checked in the first phase of git-mv, eg. 'permission denied'. Still, option -k should work.

Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
---
 git-mv.perl |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

applies-to: 6ff4820f59a60e776e7a853cbe0fdbb908f3d8af 190f908c52de643bcb05a11d8537551bd1df067f

Show changes to git-mv.perl +5 −0
diff --git a/git-mv.perl b/git-mv.perl
index 8d294d6..65b1dcf 100755
--- a/git-mv.perl
+++ b/git-mv.perl
@@ -151,6 +151,11 @@ while(scalar @srcs > 0) {
     if (!$opt_n) {
 	if (!rename($src,$dst)) {
 	    $bad = "renaming '$src' failed: $!";
+	    if ($opt_k) {
+		print "Warning: skipped: $bad\n";
+		$bad = "";
+		next;
+	    }
 	    last;
 	}
     }
---
0.99.9.GIT

← back to recent threads