diff mbox series

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

Message ID d477b02b5a3ca6d2beef5bdea21407a3c555f83e.1605710947.git.gitgitgadget@gmail.com (mailing list archive)
State Accepted
Commit bce46b1adc57945c26dea91829dfa7315f9292e7
Headers show
Series t2106 vs. the default branch name | expand

Commit Message

Johannes Schindelin Nov. 18, 2020, 2:49 p.m. UTC
From: Johannes Schindelin <johannes.schindelin@gmx.de>

We do have this wonderful shortcut `git checkout -` to go back to the
previous branch, thanks to the reflog.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t2106-update-index-assume-unchanged.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Junio C Hamano Nov. 18, 2020, 6:26 p.m. UTC | #1
"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:

> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> We do have this wonderful shortcut `git checkout -` to go back to the
> previous branch, thanks to the reflog.

;-)

>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
>  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
diff mbox series

Patch

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