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>
John Cai committed
Jan 19, 2024 at 20:18 UTC
99a294bcdb84152fa3d4868666227c1e49378727
1 file changed
+6
-6
t/t3903-stash.sh
+6
-6
@@ -200,7 +200,7 @@ test_expect_success 'drop stash reflog updates refs/stash' '
200
test_cmp expect actual
201
'
202
203
-test_expect_success REFFILES 'drop stash reflog updates refs/stash with rewrite' '
203
+test_expect_success 'drop stash reflog updates refs/stash with rewrite' '
204
git init repo &&
205
(
206
cd repo &&
@@ -213,16 +213,16 @@ test_expect_success REFFILES 'drop stash reflog updates refs/stash with rewrite'
213
new_oid="$(git -C repo rev-parse stash@{0})" &&
214
215
cat >expect <<-EOF &&
216
- $(test_oid zero) $old_oid
217
- $old_oid $new_oid
216
+ $new_oid
217
+ $old_oid
218
EOF
219
- cut -d" " -f1-2 repo/.git/logs/refs/stash >actual &&
219
+ git -C repo reflog show refs/stash --format=%H >actual &&
220
test_cmp expect actual &&
221
222
git -C repo stash drop stash@{1} &&
223
- cut -d" " -f1-2 repo/.git/logs/refs/stash >actual &&
223
+ git -C repo reflog show refs/stash --format=%H >actual &&
224
cat >expect <<-EOF &&
225
- $(test_oid zero) $new_oid
225
+ $new_oid
226
EOF
227
test_cmp expect actual
228
'