Skip to content

Commit 99a294b

Browse files
john-caigitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent dfc9486 commit 99a294b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

t/t3903-stash.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ test_expect_success 'drop stash reflog updates refs/stash' '
200200
test_cmp expect actual
201201
'
202202

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' '
204204
git init repo &&
205205
(
206206
cd repo &&
@@ -213,16 +213,16 @@ test_expect_success REFFILES 'drop stash reflog updates refs/stash with rewrite'
213213
new_oid="$(git -C repo rev-parse stash@{0})" &&
214214
215215
cat >expect <<-EOF &&
216-
$(test_oid zero) $old_oid
217-
$old_oid $new_oid
216+
$new_oid
217+
$old_oid
218218
EOF
219-
cut -d" " -f1-2 repo/.git/logs/refs/stash >actual &&
219+
git -C repo reflog show refs/stash --format=%H >actual &&
220220
test_cmp expect actual &&
221221
222222
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 &&
224224
cat >expect <<-EOF &&
225-
$(test_oid zero) $new_oid
225+
$new_oid
226226
EOF
227227
test_cmp expect actual
228228
'

0 commit comments

Comments
 (0)