mirror of
https://github.com/git/git
synced 2024-08-24 18:26:02 +00:00
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>
This commit is contained in:
parent
30aa4fb15f
commit
1d398a0390
|
@ -753,6 +753,10 @@ sub edit_hunk_manually {
|
|||
|| $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…
Reference in a new issue