Skip to content

Commit

Permalink
t3905: use test_cmp() to check file contents
Browse files Browse the repository at this point in the history
Modernize the script by doing file content comparisons using test_cmp()
instead of `test x = "$(cat file)"`.

Signed-off-by: Denton Liu <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
Denton-L authored and gitster committed Feb 11, 2021
1 parent 27e25a8 commit 8c2462d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions t/t3905-stash-include-untracked.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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' '
Expand Down

0 comments on commit 8c2462d

Please sign in to comment.