summaryrefslogtreecommitdiffstats
path: root/t/t7810-grep.sh
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2023-02-06 23:44:32 +0100
committerJunio C Hamano <gitster@pobox.com>2023-02-07 00:30:42 +0100
commitc7e03b4e39d40b431764797d3a792169cd375705 (patch)
tree3ffa800c66d1ab89cefaa0f03916884d3ba6bec7 /t/t7810-grep.sh
parenttests: don't lose exit status with "(cd ...; test <op> $(git ...))" (diff)
downloadgit-c7e03b4e39d40b431764797d3a792169cd375705.tar.xz
git-c7e03b4e39d40b431764797d3a792169cd375705.zip
tests: don't lose "git" exit codes in "! ( git ... | grep )"
Change tests that would lose the "git" exit code via a negation pattern to: - In the case of "t0055-beyond-symlinks.sh" compare against the expected output instead. We could use the same pattern as in the "t3700-add.sh" below, doing so would have the advantage that if we added an earlier test we wouldn't need to adjust the "expect" output. But as "t0055-beyond-symlinks.sh" is a small and focused test (less than 40 lines in total) let's use "test_cmp" instead. - For "t3700-add.sh" use "sed -n" to print the expected "bad" part, and use "test_must_be_empty" to assert that it's not there. If we used "grep" we'd get a non-zero exit code. We could use "test_expect_code 1 grep", but this is more consistent with existing patterns in the test suite. We can also remove a repeated invocation of "git ls-files" for the last test that's being modified in that file, and search the existing "files" output instead. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7810-grep.sh')
0 files changed, 0 insertions, 0 deletions