From: Johan Herland <johan@herland•net>
To: Daniel Barkalow <barkalow@iabervon•org>
Cc: git@vger•kernel.org
Subject: [PATCH 3/4] Prepare testsuite for a "git clone" that packs refs
Date: Mon, 14 Apr 2008 10:03:39 +0200 [thread overview]
Message-ID: <200804141003.39170.johan@herland.net> (raw)
In-Reply-To: <200804141000.09515.johan@herland.net>
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 therefore teaches t5515-fetch-merge-logic to also
remove the refs in question from the packed-refs file.
Signed-off-by: Johan Herland <johan@herland•net>
---
t/t5515-fetch-merge-logic.sh | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh
index 65c3774..8a8c35c 100755
--- a/t/t5515-fetch-merge-logic.sh
+++ b/t/t5515-fetch-merge-logic.sh
@@ -145,6 +145,25 @@ do
rm -f .git/refs/heads/*
rm -f .git/refs/remotes/rem/*
rm -f .git/refs/tags/*
+ cat .git/packed-refs | \
+ while read sha1 refname
+ do
+ case "$sha1" in
+ ^*) # remove peeled tags
+ ;;
+ *)
+ case "$refname" in
+ refs/heads/*|\
+ refs/remotes/rem/*|\
+ refs/tags/*) # remove same as above
+ ;;
+ *) # keep everything else
+ echo "$sha1 $refname"
+ ;;
+ esac
+ esac
+ done > .git/packed-refs.new
+ mv .git/packed-refs.new .git/packed-refs
git fetch "$@" >/dev/null
cat .git/FETCH_HEAD
} >"$actual_f" &&
--
1.5.5.159.g8c84b
next prev parent reply other threads:[~2008-04-14 8:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-22 1:10 [RFC/PATCH 0/3] Teach builtin-clone to pack refs Johan Herland
2008-03-22 1:12 ` [RFC/PATCH 1/3] Move pack_refs() and friends into libgit Johan Herland
2008-03-22 1:13 ` [RFC/PATCH 2/3] Prepare testsuite for a "git clone" that packs refs Johan Herland
2008-04-14 6:10 ` Daniel Barkalow
2008-04-14 8:00 ` Johan Herland
2008-04-14 8:02 ` [PATCH 1/4] Incorporate fetched packs in future object traversal Johan Herland
2008-04-14 8:02 ` [PATCH 2/4] Move pack_refs() and friends into libgit Johan Herland
2008-04-14 8:03 ` Johan Herland [this message]
2008-04-14 8:04 ` [PATCH 4/4] Teach "git clone" to pack refs Johan Herland
2008-03-22 1:13 ` [PATCH 3/3] " Johan Herland
2008-03-22 1:31 ` Daniel Barkalow
2008-03-23 0:45 ` [RFC/PATCH 0/3] Teach builtin-clone " Junio C Hamano
2008-03-23 9:49 ` Johan Herland
-- strict thread matches above, loose matches on Subject: below --
2008-06-15 14:02 [PATCH 0/4] Teach "git clone" " Johan Herland
2008-06-15 14:05 ` [PATCH 3/4] Prepare testsuite for a "git clone" that packs refs Johan Herland
2008-06-15 17:54 ` Jeff King
2008-06-15 18:04 ` Jakub Narebski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200804141003.39170.johan@herland.net \
--to=johan@herland$(echo .)net \
--cc=barkalow@iabervon$(echo .)org \
--cc=git@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox