]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t2200-add-update.sh
Merge branch 'gc/branch-recurse-submodules-fix'
[thirdparty/git.git] / t / t2200-add-update.sh
index acd3650d3c08cc2ef8227c95d6c89dfd0f063b2f..0c38f8e35695745c8eb02fe090c0d15b6d1666c8 100755 (executable)
@@ -14,7 +14,6 @@ only the updates to dir/sub.
 Also tested are "git add -u" without limiting, and "git add -u"
 without contents changes, and other conditions'
 
-TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success setup '
@@ -41,20 +40,28 @@ test_expect_success update '
 '
 
 test_expect_success 'update noticed a removal' '
-       test "$(git ls-files dir1/sub1)" = ""
+       git ls-files dir1/sub1 >out &&
+       test_must_be_empty out
 '
 
 test_expect_success 'update touched correct path' '
-       test "$(git diff-files --name-status dir2/sub3)" = ""
+       git diff-files --name-status dir2/sub3 >out &&
+       test_must_be_empty out
 '
 
 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"
+       echo "M check" >expect &&
+       git diff-files --name-status check >actual &&
+       test_cmp expect actual &&
+
+       echo "M top" >expect &&
+       git diff-files --name-status top >actual &&
+       test_cmp expect actual
 '
 
 test_expect_success 'update did not touch untracked files' '
-       test "$(git ls-files dir2/other)" = ""
+       git ls-files dir2/other >out &&
+       test_must_be_empty out
 '
 
 test_expect_success 'cache tree has not been corrupted' '
@@ -76,9 +83,8 @@ test_expect_success 'update from a subdirectory' '
 '
 
 test_expect_success 'change gets noticed' '
-
-       test "$(git diff-files --name-status dir1)" = ""
-
+       git diff-files --name-status dir1 >out &&
+       test_must_be_empty out
 '
 
 test_expect_success 'non-qualified update in subdir updates from the root' '
@@ -103,7 +109,8 @@ test_expect_success 'replace a file with a symlink' '
 test_expect_success 'add everything changed' '
 
        git add -u &&
-       test -z "$(git diff-files)"
+       git diff-files >out &&
+       test_must_be_empty out
 
 '
 
@@ -111,7 +118,8 @@ test_expect_success 'touch and then add -u' '
 
        touch check &&
        git add -u &&
-       test -z "$(git diff-files)"
+       git diff-files >out &&
+       test_must_be_empty out
 
 '
 
@@ -119,7 +127,8 @@ test_expect_success 'touch and then add explicitly' '
 
        touch check &&
        git add check &&
-       test -z "$(git diff-files)"
+       git diff-files >out &&
+       test_must_be_empty out
 
 '