diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-12-08 22:37:50 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-12-08 22:37:50 -0800 |
commit | a876433c5fc27cc14860dea3d608ab4e0ff62380 (patch) | |
tree | cfe391565fbf9c93b86ebd53f2d6b63bb99b6a74 /git-add--interactive.perl | |
parent | aa031314bf8189a15290d5bd0d85fa2a0307ceb7 (diff) | |
parent | 8947fdd598848b8ceb2cea9ff42e906c946eae5c (diff) | |
download | git-a876433c5fc27cc14860dea3d608ab4e0ff62380.tar.gz |
Merge branch 'jk/maint-add-p-delete-fix' into maint
* jk/maint-add-p-delete-fix:
add-interactive: fix deletion of non-empty files
Diffstat (limited to 'git-add--interactive.perl')
-rwxr-xr-x | git-add--interactive.perl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/git-add--interactive.perl b/git-add--interactive.perl index 8ce1ec92c2..75b71967a7 100755 --- a/git-add--interactive.perl +++ b/git-add--interactive.perl @@ -1217,7 +1217,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); } |