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

[PATCH] t6050 (replace): fix bogus "fetch branch with replacement" test

From
Christian Couder <chriscool@tuxfamily.org>
Date
Sep 26, 2010, 05:20 UTC
Message-ID
<20100926052019.13598.5764.chriscool@tuxfamily.org>

The test was missing some "&&" at the end of some lines and it was wrong because, as the replacement refs were not fetched, the commits from the parallel branch should not show up. This was found by Elijah Newren.

This is fixed by checking that after the branch from HASH6 is fetched, the commits from the parallel branch don't show up, and then by fetching the replacement refs and checking that they do show up afterwards.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 t/t6050-replace.sh |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh
index c907523..95b180f 100755
--- a/t/t6050-replace.sh
+++ b/t/t6050-replace.sh
@@ -205,9 +205,16 @@ test_expect_success 'fetch branch with replacement' '
      git branch tofetch $HASH6 &&
      (
 	  cd clone_dir &&
-	  git fetch origin refs/heads/tofetch:refs/heads/parallel3
-	  git log --pretty=oneline parallel3 | grep $PARA3
-	  git show $PARA3 | grep "A U Thor"
+	  git fetch origin refs/heads/tofetch:refs/heads/parallel3 &&
+	  git log --pretty=oneline parallel3 > output.txt &&
+	  ! grep $PARA3 output.txt &&
+	  git show $PARA3 > para3.txt &&
+	  grep "A U Thor" para3.txt &&
+	  git fetch origin "refs/replace/*:refs/replace/*" &&
+	  git log --pretty=oneline parallel3 > output.txt &&
+	  grep $PARA3 output.txt &&
+	  git show $PARA3 > para3.txt &&
+	  grep "O Thor" para3.txt
      )
 '
 
-- 
1.7.3.256.g00e8a
Message 1 of 1 in “t6050 (replace): fix bogus "fetch branch with replacement" test”
  1. t6050 (replace): fix bogus "fetch branch with replacement" testChristian Couder, Sep 26, 2010

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.