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

[PATCH] t1507: Test that branchname@{upstream} is interpreted as branch

From
Kacper Kornet <draenog@pld-linux.org>
Date
Mar 17, 2013, 22:17 UTC
Message-ID
<20130317221708.GA7707@camk.edu.pl>
In-Reply-To
<1363459903-32358-1-git-send-email-draenog@pld-linux.org>

Syntax branchname@{upstream} should interpret its argument as a name of a branch. Add the test to check that it doesn't try to interpret it as a refname if the branch in question does not exist.

Signed-off-by: Kacper Kornet <draenog@pld-linux.org>
---
Maybe I'm too cautious adding this test. But just in case here it is.
 t/t1507-rev-parse-upstream.sh | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/t/t1507-rev-parse-upstream.sh b/t/t1507-rev-parse-upstream.sh
index d6e5761..b27a720 100755
--- a/t/t1507-rev-parse-upstream.sh
+++ b/t/t1507-rev-parse-upstream.sh
@@ -54,6 +54,10 @@ test_expect_success 'my-side@{upstream} resolves to correct full name' '
 	test refs/remotes/origin/side = "$(full_name my-side@{u})"
 '
 
+test_expect_success 'refs/heads/my-side@{upstream} does not resolve to my-side{upstream}' '
+	test_must_fail full_name refs/heads/my-side@{upstream}
+'
+
 test_expect_success 'my-side@{u} resolves to correct commit' '
 	git checkout side &&
 	test_commit 5 &&
-- 
1.8.2
Previous: Eric Sunshine
Message 3 of 3 in “rev-parse: Clarify documentation of @{upstream} syntax”
  1. rev-parse: Clarify documentation of @{upstream} syntaxKacper Kornet, Mar 16, 2013
  2. Eric SunshineMar 17, 2013
  3. t1507: Test that branchname@{upstream} is interpreted as branchKacper Kornet, Mar 17, 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.