summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-04-26 10:35:07 -0700
committerJunio C Hamano <gitster@pobox.com>2012-04-26 10:35:07 -0700
commit4579a0547cc558bd0e341adb77897e1f2f331f78 (patch)
tree4ce984365e8935077422adcff522a2ac31c7ea03 /t
parent695db86ad73cc3c1dca43fb60cdf469f8d26e358 (diff)
parent4066bd6797a36ece00ffcb4814edc11e5ed25f68 (diff)
downloadgit-4579a0547cc558bd0e341adb77897e1f2f331f78.tar.gz
Merge branch 'jk/add-p-skip-conflicts' into maint
"git add -p" is not designed to deal with unmerged paths but did not exclude them and tried to apply funny patches only to fail. By Jeff King * jk/add-p-skip-conflicts: add--interactive: ignore unmerged entries in patch mode
Diffstat (limited to 't')
-rwxr-xr-xt/t3701-add-interactive.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh
index 9e236f9cc0..098a6ae4a0 100755
--- a/t/t3701-add-interactive.sh
+++ b/t/t3701-add-interactive.sh
@@ -330,4 +330,30 @@ test_expect_success PERL 'split hunk "add -p (edit)"' '
! grep "^+15" actual
'
+test_expect_success 'patch mode ignores unmerged entries' '
+ git reset --hard &&
+ test_commit conflict &&
+ test_commit non-conflict &&
+ git checkout -b side &&
+ test_commit side conflict.t &&
+ git checkout master &&
+ test_commit master conflict.t &&
+ test_must_fail git merge side &&
+ echo changed >non-conflict.t &&
+ echo y | git add -p >output &&
+ ! grep a/conflict.t output &&
+ cat >expected <<-\EOF &&
+ * Unmerged path conflict.t
+ diff --git a/non-conflict.t b/non-conflict.t
+ index f766221..5ea2ed4 100644
+ --- a/non-conflict.t
+ +++ b/non-conflict.t
+ @@ -1 +1 @@
+ -non-conflict
+ +changed
+ EOF
+ git diff --cached >diff &&
+ test_cmp expected diff
+'
+
test_done