Code

Merge branch 'ag/blame-encoding'
[git.git] / t / t2200-add-update.sh
index b664341926071a3286ba949dc09b5e62b280e79a..cd9231cf614c4326518632e514ccc68a5dc59223 100755 (executable)
@@ -26,7 +26,7 @@ test_expect_success setup '
        echo initial >dir2/sub3 &&
        git add check dir1 dir2 top foo &&
        test_tick
-       git-commit -m initial &&
+       git commit -m initial &&
 
        echo changed >check &&
        echo changed >top &&
@@ -40,20 +40,20 @@ test_expect_success update '
 '
 
 test_expect_success 'update noticed a removal' '
-       test "$(git-ls-files dir1/sub1)" = ""
+       test "$(git ls-files dir1/sub1)" = ""
 '
 
 test_expect_success 'update touched correct path' '
-       test "$(git-diff-files --name-status dir2/sub3)" = ""
+       test "$(git diff-files --name-status dir2/sub3)" = ""
 '
 
 test_expect_success 'update did not touch other tracked files' '
-       test "$(git-diff-files --name-status check)" = "M       check" &&
-       test "$(git-diff-files --name-status top)" = "M top"
+       test "$(git diff-files --name-status check)" = "M       check" &&
+       test "$(git diff-files --name-status top)" = "M top"
 '
 
 test_expect_success 'update did not touch untracked files' '
-       test "$(git-ls-files dir2/other)" = ""
+       test "$(git ls-files dir2/other)" = ""
 '
 
 test_expect_success 'cache tree has not been corrupted' '
@@ -111,4 +111,21 @@ test_expect_success 'touch and then add explicitly' '
 
 '
 
+test_expect_success 'add -n -u should not add but just report' '
+
+       (
+               echo "add '\''check'\''" &&
+               echo "remove '\''top'\''"
+       ) >expect &&
+       before=$(git ls-files -s check top) &&
+       echo changed >>check &&
+       rm -f top &&
+       git add -n -u >actual &&
+       after=$(git ls-files -s check top) &&
+
+       test "$before" = "$after" &&
+       test_cmp expect actual
+
+'
+
 test_done