]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t3905: use test_cmp() to check file contents
authorDenton Liu <liu.denton@gmail.com>
Tue, 9 Feb 2021 07:28:52 +0000 (23:28 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 11 Feb 2021 21:34:58 +0000 (13:34 -0800)
Modernize the script by doing file content comparisons using test_cmp()
instead of `test x = "$(cat file)"`.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3905-stash-include-untracked.sh

index c87ac24042f2826317ffcd51868fb353c5e3fb20..b26a97aef46e5846edb25228a1f6472f72964853 100755 (executable)
@@ -103,8 +103,10 @@ test_expect_success 'stash pop after save --include-untracked leaves files untra
        git stash pop &&
        git status --porcelain >actual &&
        test_cmp expect actual &&
-       test "1" = "$(cat file2)" &&
-       test untracked = "$(cat untracked/untracked)"
+       echo 1 >expect_file2 &&
+       test_cmp expect_file2 file2 &&
+       echo untracked >untracked_expect &&
+       test_cmp untracked_expect untracked/untracked
 '
 
 test_expect_success 'clean up untracked/ directory to prepare for next tests' '