From: Deskin Miller Date: Thu, 12 Feb 2009 05:19:41 +0000 (-0500) Subject: add -i: revisit hunk on editor failure X-Git-Tag: v1.6.3-rc0~213^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1d398a03902aab8ec49197d8827c19f9e2203c98;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/git-add--interactive.perl b/git-add--interactive.perl index 5f129a420..f7b076173 100755 --- a/git-add--interactive.perl +++ b/git-add--interactive.perl @@ -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>;