diff options
author | Khalid Masum <khalid.masum.92@gmail.com> | 2022-04-05 13:47:42 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-04-06 07:59:25 -0700 |
commit | 82b28c4ed802bbf96262e5416916441184cd2d4b (patch) | |
tree | cfed0a7aaa94c86d07230242c89c370561b62d70 /commit.c | |
parent | 4c53a8c20f8984adb226293a3ffd7b88c3f4ac1a (diff) |
t3501: remove test -f and stop ignoring git <cmd> exit code
In the test 'cherry-pick after renaming branch', stop checking for
the presence of a file (opos) because we are going to "grep" in it in
the same test and the lack of it will be noticed as a failure anyway.
In the test 'revert after renaming branch', instead of allowing any
random contents as long as a known phrase is not there in it, we can
expect the exact outcome---after the successful revert of "added", the
contents of file "spoo" should become identical to what was in file
"oops" in the "initial" commit. This test also contains 'test -f' that
verifies presence of a file, but we have a helper function to do the same
thing. Replace it with appropriate helper function 'test_path_is_file'
for better readability and better error messages.
In both tests, we will not notice when "git rev-parse" starts segfaulting
without emitting any output. The 'test' command will end up being just
"test =", which yields success. Use the 'test_cmp_rev' helper to make
sure we will notice such a breakage.
Signed-off-by: Khalid Masum <khalid.masum.92@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
0 files changed, 0 insertions, 0 deletions