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

[PATCH 3/4] t3200: restore branch after "unborn --edit-description" test

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Jan 1, 2018, 22:54 UTC
Message-ID
<20180101225448.2561-4-szeder.dev@gmail.com>
In-Reply-To
<20180101225448.2561-1-szeder.dev@gmail.com>

The test 'refuse --edit-description on unborn branch for now' switches to an orphan branch and leaves the test repository in that state. This might badly influence the subsequent test expecting 'git branch --merged' to error out, by hiding a potential regression with an error triggered by the unborn branch. Furthermore, a new test that will be added later in this series failed first because of this.

Use test_when_finished to switch back to the master branch at the end of the test in question.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
---
 t/t3200-branch.sh | 1 +
 1 file changed, 1 insertion(+)
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index e9f55ac04..427ad490d 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -1234,6 +1234,7 @@ test_expect_success 'refuse --edit-description on unborn branch for now' '
 	write_script editor <<-\EOF &&
 		echo "New contents" >"$1"
 	EOF
+	test_when_finished git checkout master &&
 	git checkout --orphan unborn &&
 	test_must_fail env EDITOR=./editor git branch --edit-description
 '
-- 
2.16.0.rc0.67.g3a46dbca7
Previous: SZEDER GáborNext: SZEDER Gábor
Message 9 of 10 in “branch: add '--show-description' option”
  1. 0/4 branch: add '--show-description' optionSZEDER Gábor, Jan 1, 2018
  2. 2/4 t3200: fix a misindented lineSZEDER Gábor, Jan 1, 2018
  3. 4/4 branch: add '--show-description' optionSZEDER Gábor, Jan 1, 2018
  4. Eric SunshineJan 2, 2018
  5. SZEDER GáborJan 2, 2018
  6. Johannes SixtJan 2, 2018
  7. SZEDER GáborJan 2, 2018
  8. SZEDER GáborJan 2, 2018
  9. 3/4 t3200: restore branch after "unborn --edit-description" testSZEDER Gábor, Jan 1, 2018
  10. 1/4 branch: '--edit-description' is incompatible with other optionsSZEDER Gábor, Jan 1, 2018

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.