add -i: revisit hunk on editor failure
Similar to the behaviour for editing a commit message, let terminating the editor with a failure abort the current hunk edit and revisit the option selection for the hunk. Signed-off-by: Deskin Miller <deskinm@umich.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Deskin Miller committed
Feb 12, 2009 at 00:19 UTC
1d398a03902aab8ec49197d8827c19f9e2203c98
1 file changed
+4
git-add--interactive.perl
+4
@@ -753,6 +753,10 @@ EOF
753
|| $ENV{VISUAL} || $ENV{EDITOR} || "vi";
754
system('sh', '-c', $editor.' "$@"', $editor, $hunkfile);
755
756
+ if ($? != 0) {
757
+ return undef;
758
+ }
759
+
760
open $fh, '<', $hunkfile
761
or die "failed to open hunk edit file for reading: " . $!;
762
my @newtext = grep { !/^#/ } <$fh>;