Browse Source

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>
maint
Deskin Miller 16 years ago committed by Junio C Hamano
parent
commit
1d398a0390
  1. 4
      git-add--interactive.perl

4
git-add--interactive.perl

@ -753,6 +753,10 @@ EOF @@ -753,6 +753,10 @@ EOF
|| $ENV{VISUAL} || $ENV{EDITOR} || "vi";
system('sh', '-c', $editor.' "$@"', $editor, $hunkfile);

if ($? != 0) {
return undef;
}

open $fh, '<', $hunkfile
or die "failed to open hunk edit file for reading: " . $!;
my @newtext = grep { !/^#/ } <$fh>;

Loading…
Cancel
Save