@matheusbsbs / matheus-bagliano / commits / d0d12b4768
Fork 0

Prepare testsuite for a "git clone" that packs refs

t5515-fetch-merge-logic removes many, but not all, refs between each test. This is done by removing the corresponding refs/foo/* files in the .git/refs hierarchy. However, once "git clone" starts producing packed refs, these refs will no longer be in the .git/refs hierarchy, but rather listed in .git/packed-refs. This patch teaches t5515-fetch-merge-logic to remove the refs using "git update-ref -d" which properly handles packed refs. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johan Herland committed Jun 16, 2008 at 01:16 UTC d0d12b476822bb8686ee883bd44b799563069a48
1 file changed +6 -3
t/t5515-fetch-merge-logic.sh
+6 -3
@@ -142,9 +142,12 @@ do
142 set x $cmd; shift
143 git symbolic-ref HEAD refs/heads/$1 ; shift
144 rm -f .git/FETCH_HEAD
145 - rm -f .git/refs/heads/*
146 - rm -f .git/refs/remotes/rem/*
147 - rm -f .git/refs/tags/*
145 + git for-each-ref \
146 + refs/heads refs/remotes/rem refs/tags |
147 + while read val type refname
148 + do
149 + git update-ref -d "$refname" "$val"
150 + done
151 git fetch "$@" >/dev/null
152 cat .git/FETCH_HEAD
153 } >"$actual_f" &&