summaryrefslogtreecommitdiff
path: root/git-add--interactive.perl
diff options
context:
space:
mode:
authorDeskin Miller <deskinm@umich.edu>2009-02-12 00:19:41 -0500
committerJunio C Hamano <gitster@pobox.com>2009-02-11 23:51:15 -0800
commit1d398a03902aab8ec49197d8827c19f9e2203c98 (patch)
treed36fc2a4712fe6b143067dcf2a30ff80c1062024 /git-add--interactive.perl
parent30aa4fb15fa408596dea59cdc9f00c94eeaa69f1 (diff)
downloadgit-1d398a03902aab8ec49197d8827c19f9e2203c98.tar.gz
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>
Diffstat (limited to 'git-add--interactive.perl')
-rwxr-xr-xgit-add--interactive.perl4
1 files changed, 4 insertions, 0 deletions
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>;