Skip to content

Commit 1142746

Browse files
hanwengitster
authored andcommitted
t1413: use tar to save and restore entire .git directory
This makes the test independent of the particulars of the storage formats. Signed-off-by: Han-Wen Nienhuys <[email protected]> Reviewed-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b1259ec commit 1142746

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

t/t1413-reflog-detach.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
77
. ./test-lib.sh
88

99
reset_state () {
10-
git checkout main &&
11-
cp saved_reflog .git/logs/HEAD
10+
rm -rf .git && "$TAR" xf .git-saved.tar
1211
}
1312

1413
test_expect_success setup '
@@ -17,7 +16,7 @@ test_expect_success setup '
1716
git branch side &&
1817
test_tick &&
1918
git commit --allow-empty -m second &&
20-
cat .git/logs/HEAD >saved_reflog
19+
"$TAR" cf .git-saved.tar .git
2120
'
2221

2322
test_expect_success baseline '

0 commit comments

Comments
 (0)