t3905: use test_cmp() to check file contents
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>
Denton Liu committed
Feb 8, 2021 at 23:28 UTC
8c2462d1fe01fbc509827591f6b287d8af245ae1
1 file changed
+4
-2
t/t3905-stash-include-untracked.sh
+4
-2
@@ -103,8 +103,10 @@ test_expect_success 'stash pop after save --include-untracked leaves files untra
103
git stash pop &&
104
git status --porcelain >actual &&
105
test_cmp expect actual &&
106
- test "1" = "$(cat file2)" &&
107
- test untracked = "$(cat untracked/untracked)"
106
+ echo 1 >expect_file2 &&
107
+ test_cmp expect_file2 file2 &&
108
+ echo untracked >untracked_expect &&
109
+ test_cmp untracked_expect untracked/untracked
110
'
111
112
test_expect_success 'clean up untracked/ directory to prepare for next tests' '