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

From: SZEDER Gábor <[email-masked]>
Date: Mon, 1 Jan 2018 23:54:47 +0100

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 <[email-masked]>
---
 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