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

Re: [PATCH] fetch: don't try to update unfetched tracking refs

From
Jeff King <peff@peff.net>
Date
May 27, 2013, 15:42 UTC
Message-ID
<20130527154252.GB8250@sigill.intra.peff.net>
In-Reply-To
<9c6fd36368cd6b0fba4855be4d31106781c02f58.1369654825.git.john@keeping.me.uk>
On Mon, May 27, 2013 at 12:40:25PM +0100, John Keeping wrote:
Show 5 quoted lines
> Since commit f269048 (fetch: opportunistically update tracking refs,
> 2013-05-11) we update tracking refs opportunistically when fetching
> remote branches.  However, if a refspec is given on the command line
> that does not include a configured (non-pattern) refspec a fatal error
> occurs.

I'm not sure I understand what the last sentence means. I tried to add a test like:

diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index ff43e08..02e30e1 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -422,6 +422,16 @@ test_expect_success 'configured fetch updates tracking' '
 	)
 '
 
+test_expect_success 'non-configured ref does not confuse tracking update' '
+	cd "$D" &&
+	git update-ref refs/odd/location HEAD &&
+	(
+		cd three &&
+		git fetch origin refs/odd/location &&
+		git rev-parse --verify FETCH_HEAD
+	)
+'
+
 test_expect_success 'pushing nonexistent branch by mistake should not segv' '
 
 	cd "$D" &&

but it does not fail with the existing code. Can you give an example
that fails?

-Peff
Previous: John KeepingNext: John Keeping
Message 2 of 6 in “fetch: don't try to update unfetched tracking refs”
  1. fetch: don't try to update unfetched tracking refsJohn Keeping, May 27, 2013
  2. Jeff KingMay 27, 2013
  3. John KeepingMay 27, 2013
  4. Jeff KingMay 27, 2013
  5. fetch: don't try to update unfetched tracking refsJohn Keeping, May 27, 2013
  6. Jeff KingMay 27, 2013

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.