summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Herland <johan@herland.net>2008-06-15 23:16:53 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-06-19 22:53:13 (GMT)
commitd0d12b476822bb8686ee883bd44b799563069a48 (patch)
tree5d88f91e98962c025850f6c2adc50617611c89f4
parent94e724a741590e741a540075c07a961082e3c80a (diff)
downloadgit-d0d12b476822bb8686ee883bd44b799563069a48.zip
git-d0d12b476822bb8686ee883bd44b799563069a48.tar.gz
git-d0d12b476822bb8686ee883bd44b799563069a48.tar.bz2
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>
-rwxr-xr-xt/t5515-fetch-merge-logic.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh
index 3def75e..8becbc3 100755
--- a/t/t5515-fetch-merge-logic.sh
+++ b/t/t5515-fetch-merge-logic.sh
@@ -142,9 +142,12 @@ do
set x $cmd; shift
git symbolic-ref HEAD refs/heads/$1 ; shift
rm -f .git/FETCH_HEAD
- rm -f .git/refs/heads/*
- rm -f .git/refs/remotes/rem/*
- rm -f .git/refs/tags/*
+ git for-each-ref \
+ refs/heads refs/remotes/rem refs/tags |
+ while read val type refname
+ do
+ git update-ref -d "$refname" "$val"
+ done
git fetch "$@" >/dev/null
cat .git/FETCH_HEAD
} >"$actual_f" &&