diff options
-rwxr-xr-x | git-add--interactive.perl | 4 | ||||
-rwxr-xr-x | t/t3701-add-interactive.sh | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/git-add--interactive.perl b/git-add--interactive.perl index a06172c69f..e6f93c7c95 100755 --- a/git-add--interactive.perl +++ b/git-add--interactive.perl @@ -841,6 +841,10 @@ sub coalesce_overlapping_hunks { my ($last_o_ctx, $last_was_dirty); for (grep { $_->{USE} } @in) { + if ($_->{TYPE} ne 'hunk') { + push @out, $_; + next; + } my $text = $_->{TEXT}; my ($o_ofs) = parse_hunk_header($text->[0]); if (defined $last_o_ctx && diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh index b68141f48a..63940b1893 100755 --- a/t/t3701-add-interactive.sh +++ b/t/t3701-add-interactive.sh @@ -164,7 +164,7 @@ test_expect_success FILEMODE 'stage mode but not hunk' ' ' -test_expect_failure FILEMODE 'stage mode and hunk' ' +test_expect_success FILEMODE 'stage mode and hunk' ' git reset --hard && echo content >>file && chmod +x file && |