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

[PATCHv2 6/8] t9114.2: Don't use --track option against "svn-remote"-tracking branches

From
Johan Herland <johan@herland.net>
Date
Apr 20, 2013, 15:06 UTC
Message-ID
<1366470363-22309-7-git-send-email-johan@herland.net>
In-Reply-To
<1366470363-22309-1-git-send-email-johan@herland.net>

We are formalizing a requirement that any remote-tracking branch to be used as an upstream (i.e. as an argument to --track), _must_ "belong" to a configured remote by being matched by the "dst" side of a fetch refspec.

This test uses --track against a "remotes/trunk" ref which does not belong to any configured (git) remotes, but is instead created by "git svn fetch" operating on an svn-remote. It does not make sense to use an svn-remote as an upstream for a local branch, as a regular "git pull" from (or "git push" to) it would obviously fail (instead you would need to use "git svn" to communicate with this remote). Furthermore, the usage of --track in this case is unnecessary, since the upstreaming config that would be created is never used.

Simply removing --track fixes the issue without changing the expected behavior of the test.

Cc: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Johan Herland <johan@herland.net>
---
 t/t9114-git-svn-dcommit-merge.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t9114-git-svn-dcommit-merge.sh b/t/t9114-git-svn-dcommit-merge.sh
index 3077851..f524d2f 100755
--- a/t/t9114-git-svn-dcommit-merge.sh
+++ b/t/t9114-git-svn-dcommit-merge.sh
@@ -48,7 +48,7 @@ test_expect_success 'setup svn repository' '
 test_expect_success 'setup git mirror and merge' '
 	git svn init "$svnrepo" -t tags -T trunk -b branches &&
 	git svn fetch &&
-	git checkout --track -b svn remotes/trunk &&
+	git checkout -b svn remotes/trunk &&
 	git checkout -b merge &&
 	echo new file > new_file &&
 	git add new_file &&
-- 
1.8.1.3.704.g33f7d4f
Previous: Johan HerlandNext: Eric Wong
Message 9 of 12 in “[PATCHv2 0/8] Improving the search for remote-tracking branches”
  1. Johan HerlandApr 20, 2013
  2. 1/8 t2024: Add tests verifying current DWIM behavior of 'git checkout <branch>'Johan Herland, Apr 20, 2013
  3. Jonathan NiederApr 20, 2013
  4. Johan HerlandApr 20, 2013
  5. 2/8 t2024: Show failure to use refspec when DWIMming remote branch namesJohan Herland, Apr 20, 2013
  6. 3/8 checkout: Use remote refspecs when DWIMming tracking branchesJohan Herland, Apr 20, 2013
  7. 4/8 t3200.39: tracking setup should fail if there is no matching refspec.Johan Herland, Apr 20, 2013
  8. 5/8 t7201.24: Add refspec to keep --track workingJohan Herland, Apr 20, 2013
  9. 6/8 t9114.2: Don't use --track option against "svn-remote"-tracking branchesJohan Herland, Apr 20, 2013
  10. Eric WongApr 21, 2013
  11. 7/8 branch.c: Validate tracking branches with refspecs instead of refs/remotes/*Johan Herland, Apr 20, 2013
  12. 8/8 glossary: Update and rephrase the definition of a remote-tracking branchJohan Herland, Apr 20, 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.