diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-05-13 22:01:15 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-05-13 22:01:15 +0400 |
commit | f7d59e256884f63adeed9a1f3376a386a28681ff (patch) | |
tree | d79d33ee5fa727db52c2bcba4c5e66841538d102 /t | |
parent | 3e1a363b1ff748237f3a6e4f3e2803445f09c54c (diff) | |
parent | 75973b2cb58bf2b3038c5c214fc0a1b96d6868fe (diff) |
Merge branch 'jc/fix-add-u-unmerged'
* jc/fix-add-u-unmerged:
Fix "add -u" that sometimes fails to resolve unmerged paths
Diffstat (limited to 't')
-rwxr-xr-x | t/t2200-add-update.sh | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh index 2d7d3115d5..4cdebda6a5 100755 --- a/t/t2200-add-update.sh +++ b/t/t2200-add-update.sh @@ -149,31 +149,21 @@ test_expect_success 'add -u resolves unmerged paths' ' echo 3 >path1 && echo 2 >path3 && echo 2 >path5 && - git add -u && - git ls-files -s path1 path2 path3 path4 path5 path6 >actual && - { - echo "100644 $three 0 path1" - echo "100644 $one 1 path3" - echo "100644 $one 1 path4" - echo "100644 $one 3 path5" - echo "100644 $one 3 path6" - } >expect && - test_cmp expect actual && - # Bonus tests. Explicit resolving - git add path3 path5 && + # Explicit resolving by adding removed paths should fail test_must_fail git add path4 && test_must_fail git add path6 && - git rm path4 && - git rm path6 && - git ls-files -s "path?" >actual && + # "add -u" should notice removals no matter what stages + # the index entries are in. + git add -u && + git ls-files -s path1 path2 path3 path4 path5 path6 >actual && { echo "100644 $three 0 path1" echo "100644 $two 0 path3" echo "100644 $two 0 path5" - } >expect - + } >expect && + test_cmp expect actual ' test_expect_success '"add -u non-existent" should fail' ' |