diff options
| author | John Cai <johncai86@gmail.com> | 2024-01-19 20:18:58 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-01-22 15:57:25 -0800 |
| commit | 99a294bcdb84152fa3d4868666227c1e49378727 (patch) | |
| tree | d7a4c614ed556e344604f275ffc4dd8280b8260b /t | |
| parent | t1503: move reffiles specific tests to t0600 (diff) | |
| download | git-99a294bcdb84152fa3d4868666227c1e49378727.tar.gz git-99a294bcdb84152fa3d4868666227c1e49378727.zip | |
t3903: make drop stash test ref backend agnostic
In this test, the calls to cut(1) are only used to verify that the
contents of the reflog entry look as expected. By replacing these with
git-reflog(1) calls, we can make this test ref-backend agnostic.
Signed-off-by: John Cai <johncai86@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
| -rwxr-xr-x | t/t3903-stash.sh | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index 34faeac3f1..3319240515 100755 --- a/t/t3903-stash.sh +++ b/t/t3903-stash.sh @@ -200,7 +200,7 @@ test_expect_success 'drop stash reflog updates refs/stash' ' test_cmp expect actual ' -test_expect_success REFFILES 'drop stash reflog updates refs/stash with rewrite' ' +test_expect_success 'drop stash reflog updates refs/stash with rewrite' ' git init repo && ( cd repo && @@ -213,16 +213,16 @@ test_expect_success REFFILES 'drop stash reflog updates refs/stash with rewrite' new_oid="$(git -C repo rev-parse stash@{0})" && cat >expect <<-EOF && - $(test_oid zero) $old_oid - $old_oid $new_oid + $new_oid + $old_oid EOF - cut -d" " -f1-2 repo/.git/logs/refs/stash >actual && + git -C repo reflog show refs/stash --format=%H >actual && test_cmp expect actual && git -C repo stash drop stash@{1} && - cut -d" " -f1-2 repo/.git/logs/refs/stash >actual && + git -C repo reflog show refs/stash --format=%H >actual && cat >expect <<-EOF && - $(test_oid zero) $new_oid + $new_oid EOF test_cmp expect actual ' |
