git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/4] t5500: give fully-qualified refs to fetch-pack

From
Jeff King <peff@peff.net>
Date
Dec 13, 2011, 00:44 UTC
Message-ID
<20111213004440.GB3699@sigill.intra.peff.net>
In-Reply-To
<20111213003925.GA28403@sigill.intra.peff.net>

The fetch-pack documentation is very clear that refs given on the command line are to be full refs:

  <refs>...::
          The remote heads to update from. This is relative to
          $GIT_DIR (e.g. "HEAD", "refs/heads/master").  When
          unspecified, update from all heads the remote side has.

and this has been the case since fetch-pack was originally documented in 8b3d9dc ([PATCH] Documentation: clone/fetch/upload., 2005-07-14).

Let's follow our own documentation to set a good example, and to avoid breaking when this restriction is enforced in the next patch.

Signed-off-by: Jeff King <peff@peff.net>
---
This patch by itself isn't a big deal for backwards compatibility But
if we are violating the constraints in the documentation, then I worry
that others are, too. On the other hand, I seriously doubt anyone is
actually using fetch-pack directly anymore at all.
 t/t5500-fetch-pack.sh |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
index bafcca7..9bf69e9 100755
--- a/t/t5500-fetch-pack.sh
+++ b/t/t5500-fetch-pack.sh
@@ -97,7 +97,7 @@ test_expect_success 'setup' '
 	git symbolic-ref HEAD refs/heads/B
 '
 
-pull_to_client 1st "B A" $((11*3))
+pull_to_client 1st "refs/heads/B refs/heads/A" $((11*3))
 
 test_expect_success 'post 1st pull setup' '
 	add A11 $A10 &&
@@ -110,9 +110,9 @@ test_expect_success 'post 1st pull setup' '
 	done
 '
 
-pull_to_client 2nd "B" $((64*3))
+pull_to_client 2nd "refs/heads/B" $((64*3))
 
-pull_to_client 3rd "A" $((1*3))
+pull_to_client 3rd "refs/heads/A" $((1*3))
 
 test_expect_success 'clone shallow' '
 	git clone --depth 2 "file://$(pwd)/." shallow
-- 
1.7.8.13.g74677
Previous: Jeff KingNext: Jeff King
Message 3 of 8 in “exact ref-matching for fetch-pack”
  1. 0/4 exact ref-matching for fetch-packJeff King, Dec 13, 2011
  2. 1/4 drop "match" parameter from get_remote_headsJeff King, Dec 13, 2011
  3. 2/4 t5500: give fully-qualified refs to fetch-packJeff King, Dec 13, 2011
  4. 3/4 fetch-pack: match refs exactlyJeff King, Dec 13, 2011
  5. Jeff KingDec 13, 2011
  6. Junio C HamanoDec 15, 2011
  7. 4/4 connect.c: drop path_match functionJeff King, Dec 13, 2011
  8. Michael HaggertyDec 13, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.