From 1d398a03902aab8ec49197d8827c19f9e2203c98 Mon Sep 17 00:00:00 2001 From: Deskin Miller Date: Thu, 12 Feb 2009 00:19:41 -0500 Subject: [PATCH] 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 --- git-add--interactive.perl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/git-add--interactive.perl b/git-add--interactive.perl index 5f129a4203..f7b0761732 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>;