Thread (1 message) 1 message, 1 author, 2020-11-18

Re: [PATCH 2/3] t2106: make test independent of the current main branch name

From: Junio C Hamano <hidden>
Date: 2020-11-18 18:26:37

"Johannes Schindelin via GitGitGadget" [off-list ref]
writes:
From: Johannes Schindelin <redacted>

We do have this wonderful shortcut `git checkout -` to go back to the
previous branch, thanks to the reflog.
;-)
quoted hunk
Signed-off-by: Johannes Schindelin <redacted>
---
 t/t2106-update-index-assume-unchanged.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t2106-update-index-assume-unchanged.sh b/t/t2106-update-index-assume-unchanged.sh
index ff0947f388..3396f23363 100755
--- a/t/t2106-update-index-assume-unchanged.sh
+++ b/t/t2106-update-index-assume-unchanged.sh
@@ -20,7 +20,7 @@ test_expect_success 'do not switch branches with dirty file' '
 	git checkout other &&
 	echo dirt >file &&
 	git update-index --assume-unchanged file &&
-	test_must_fail git checkout master
+	test_must_fail git checkout -
 '
 
 test_done
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help