From 1d398a03902aab8ec49197d8827c19f9e2203c98 Mon Sep 17 00:00:00 2001 From: Deskin Miller Date: Thu, 12 Feb 2009 00:19:41 -0500 Subject: 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 5f129a4..f7b0761 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>; -- cgit v0.10.2-6-g49f6