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

[PATCH 3/3] contrib/subtree: Small tidy-up to test

From
Charles Bailey <charles@hashpling.org>
Date
Jun 22, 2015, 13:53 UTC
Message-ID
<1434981210-13036-3-git-send-email-charles@hashpling.org>
In-Reply-To
<1434981210-13036-1-git-send-email-charles@hashpling.org>
From: Charles Bailey <cbailey32@bloomberg.net>
There's no need to switch branches to parse another branch's ancestry.
Signed-off-by: Charles Bailey <cbailey32@bloomberg.net>
---
 contrib/subtree/t/t7900-subtree.sh | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh
index 001c604..bd3df97 100755
--- a/contrib/subtree/t/t7900-subtree.sh
+++ b/contrib/subtree/t/t7900-subtree.sh
@@ -221,9 +221,7 @@ test_expect_success 'check hash of split' '
 	spl1=$(git subtree split --prefix subdir) &&
 	git subtree split --prefix subdir --branch splitbr1test &&
 	check_equal ''"$(git rev-parse splitbr1test)"'' "$spl1" &&
-	git checkout splitbr1test &&
-	new_hash=$(git rev-parse HEAD~2) &&
-	git checkout mainline &&
+	new_hash=$(git rev-parse splitbr1test~2) &&
 	check_equal ''"$new_hash"'' "$subdir_hash"
 '
 
-- 
2.4.0.53.g8440f74
Previous: Charles BaileyNext: Eric Sunshine
Message 3 of 4 in “contrib/subtree: Use tabs consitently for indentation in tests”
  1. 1/3 contrib/subtree: Use tabs consitently for indentation in testsCharles Bailey, Jun 22, 2015
  2. 2/3 contrib/subtree: Fix broken &&-chains and revealed test errorCharles Bailey, Jun 22, 2015
  3. 3/3 contrib/subtree: Small tidy-up to testCharles Bailey, Jun 22, 2015
  4. Eric SunshineJun 22, 2015

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.