X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-add--interactive.perl;h=cd43c3491260cb2aa51f0d19fd18ab66e4ad8217;hb=748af44c63ea6fec12690f1693f3dddd963e88d5;hp=8ce1ec92c2b04e1271b3ee1a41a2ac60d2f8aad4;hpb=d1dfc016d868322638c87a23a624651874a107c2;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); }