diff options
author | Patrick Steinhardt <ps@pks.im> | 2023-10-31 11:16:59 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-11-01 06:09:01 +0300 |
commit | 0497e6c61172faabf412e013f2fc30a05054a46d (patch) | |
tree | 25d1588270a35a905b41a181037533c0873a28ad /t/t5521-pull-options.sh | |
parent | 9080a7f1782b55ee146dd7f9b4f464fe5ea8747a (diff) |
t: use git-show-ref(1) to check for ref existence
Convert tests that use `test_path_is_file` and `test_path_is_missing` to
instead use a set of helpers `test_ref_exists` and `test_ref_missing`.
These helpers are implemented via the newly introduced `git show-ref
--exists` command. Thus, we can avoid intimate knowledge of how the ref
backend stores references on disk.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5521-pull-options.sh')
-rwxr-xr-x | t/t5521-pull-options.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t5521-pull-options.sh b/t/t5521-pull-options.sh index 079b2f2536..3681859f98 100755 --- a/t/t5521-pull-options.sh +++ b/t/t5521-pull-options.sh @@ -143,7 +143,7 @@ test_expect_success 'git pull --dry-run' ' cd clonedry && git pull --dry-run ../parent && test_path_is_missing .git/FETCH_HEAD && - test_path_is_missing .git/refs/heads/main && + test_ref_missing refs/heads/main && test_path_is_missing .git/index && test_path_is_missing file ) @@ -157,7 +157,7 @@ test_expect_success 'git pull --all --dry-run' ' git remote add origin ../parent && git pull --all --dry-run && test_path_is_missing .git/FETCH_HEAD && - test_path_is_missing .git/refs/remotes/origin/main && + test_ref_missing refs/remotes/origin/main && test_path_is_missing .git/index && test_path_is_missing file ) |