summaryrefslogtreecommitdiff
path: root/git-add--interactive.perl
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-08-26 11:22:00 -0700
committerJunio C Hamano <gitster@pobox.com>2009-08-26 11:22:00 -0700
commit9e4a90ba19033d25dca1eea495b0a8c5f06efbc6 (patch)
tree5754b630105cf960385bfa374dd1d986fd2e96ff /git-add--interactive.perl
parent57f6ec029090f64377ec5c0926b6e2e39b0caa4f (diff)
parent3d792161b1c86632d5331bb30d6b7c6b17261f38 (diff)
downloadgit-9e4a90ba19033d25dca1eea495b0a8c5f06efbc6.tar.gz
Merge branch 'tr/maint-1.6.3-add-p-modeonly-fix' into maint-1.6.3
* tr/maint-1.6.3-add-p-modeonly-fix: add -p: do not attempt to coalesce mode changes git add -p: demonstrate failure when staging both mode and hunk
Diffstat (limited to 'git-add--interactive.perl')
-rwxr-xr-xgit-add--interactive.perl4
1 files changed, 4 insertions, 0 deletions
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index df9f231635..06f70602cc 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 &&