X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=inline;f=git-add--interactive.perl;h=cd43c3491260cb2aa51f0d19fd18ab66e4ad8217;hb=9c787f3f88f077ad23498cf03b1b57ac3bd41b33;hp=8ce1ec92c2b04e1271b3ee1a41a2ac60d2f8aad4;hpb=dc733ef4190dffcbcd5c1c27569fecf01f9a44bd;p=git.git diff --git a/git-add--interactive.perl b/git-add--interactive.perl index 8ce1ec92c..cd43c3491 100755 --- a/git-add--interactive.perl +++ b/git-add--interactive.perl @@ -990,8 +990,7 @@ sub edit_hunk_manually { EOF close $fh; - my $editor = $ENV{GIT_EDITOR} || $repo->config("core.editor") - || $ENV{VISUAL} || $ENV{EDITOR} || "vi"; + chomp(my $editor = run_cmd_pipe(qw(git var GIT_EDITOR))); system('sh', '-c', $editor.' "$@"', $editor, $hunkfile); if ($? != 0) { @@ -1217,7 +1216,11 @@ sub patch_update_file { if (@{$mode->{TEXT}}) { unshift @hunk, $mode; } - if (@{$deletion->{TEXT}} && !@hunk) { + if (@{$deletion->{TEXT}}) { + foreach my $hunk (@hunk) { + push @{$deletion->{TEXT}}, @{$hunk->{TEXT}}; + push @{$deletion->{DISPLAY}}, @{$hunk->{DISPLAY}}; + } @hunk = ($deletion); }