X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft2200-add-update.sh;h=7206c1374127ed7c1f9ad6d422e535458cb217b4;hb=f7045912f85a1c67f3c997202020dfb26078e978;hp=0692427cb69c62327da52061de6238ca8e12169d;hpb=02fedc0f4835de7414b78e21739464a29520c94a;p=git.git diff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh index 0692427cb..7206c1374 100755 --- a/t/t2200-add-update.sh +++ b/t/t2200-add-update.sh @@ -111,7 +111,7 @@ test_expect_success 'touch and then add explicitly' ' ' -test_expect_success 'add -n -u should not add but just report' ' +test_expect_success C_LOCALE_OUTPUT 'add -n -u should not add but just report' ' ( echo "add '\''check'\''" && @@ -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' '