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

[PATCH 1/2] Test tracking of non-commit upstreams

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
May 11, 2009, 14:42 UTC
Message-ID
<1242052974-28184-2-git-send-email-git@drmicha.warpmail.net>
In-Reply-To
<1242052974-28184-1-git-send-email-git@drmicha.warpmail.net>

git-checkout and git-branch allow setting up an arbitrary committish as the upstream reference for --track. In particular, tags are allowed. But they and git-status barf on non-commit upstreams as soon as they are asked for trackings stats.

Expose this shortcoming by adding two tests: annotated tags are affected but lightweight tags are OK.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
 t/t6040-tracking-info.sh |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh
index 3d6db4d..2397774 100755
--- a/t/t6040-tracking-info.sh
+++ b/t/t6040-tracking-info.sh
@@ -74,5 +74,19 @@ test_expect_success 'status' '
 	grep "have 1 and 1 different" actual
 '
 
+test_expect_success 'status when tracking lightweight tags' '
+	git checkout master &&
+	git tag light && 
+	git branch --track lighttrack light >actual &&
+	grep "set up to track" actual &&
+	git checkout lighttrack
+'
 
+test_expect_failure 'status when tracking annotated tags' '
+	git checkout master &&
+	git tag -m heavy heavy && 
+	git branch --track heavytrack heavy >actual &&
+	grep "set up to track" actual &&
+	git checkout heavytrack
+'
 test_done
-- 
1.6.3.195.gad816
Previous: Michael J GruberNext: Michael J Gruber
Message 2 of 4 in “Allow tags as upstreams for --track”
  1. 0/2 Allow tags as upstreams for --trackMichael J Gruber, May 11, 2009
  2. 1/2 Test tracking of non-commit upstreamsMichael J Gruber, May 11, 2009
  3. 2/2 Fix behavior with non-committish upstream referencesMichael J Gruber, May 11, 2009
  4. Michael J GruberMay 14, 2009

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.