From: John Cai Date: Fri, 19 Jan 2024 20:18:58 +0000 (+0000) Subject: t3903: make drop stash test ref backend agnostic X-Git-Tag: v2.44.0-rc0~30^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=99a294bcdb84152fa3d4868666227c1e49378727;p=thirdparty%2Fgit.git 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 Signed-off-by: Junio C Hamano --- 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 '