summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-11-30 22:49:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-11-30 22:49:41 (GMT)
commit39f95df236864e8a5227a53aedd3ee760b741e55 (patch)
treea947ce7fc25c12ed3f27752da99fc4be2c914798 /t
parente67fbf927dfdf13d0b21dc6ea15dc3c7ef448ea0 (diff)
parentb6e2a4f07c238e179e4d358e84a7f9e3a5c07005 (diff)
downloadgit-39f95df236864e8a5227a53aedd3ee760b741e55.zip
git-39f95df236864e8a5227a53aedd3ee760b741e55.tar.gz
git-39f95df236864e8a5227a53aedd3ee760b741e55.tar.bz2
Merge branch 'js/t2106-cleanup'
A test script got cleaned up and then made not to depend on the value of init.defaultBranch. * js/t2106-cleanup: t2106: ensure that the checkout fails for the expected reason t2106: make test independent of the current main branch name t2106: adjust style to the current conventions
Diffstat (limited to 't')
-rwxr-xr-xt/t2106-update-index-assume-unchanged.sh31
1 files changed, 17 insertions, 14 deletions
diff --git a/t/t2106-update-index-assume-unchanged.sh b/t/t2106-update-index-assume-unchanged.sh
index 99d858c..2d450da 100755
--- a/t/t2106-update-index-assume-unchanged.sh
+++ b/t/t2106-update-index-assume-unchanged.sh
@@ -5,20 +5,23 @@ test_description='git update-index --assume-unchanged test.
. ./test-lib.sh
-test_expect_success 'setup' \
- ': >file &&
- git add file &&
- git commit -m initial &&
- git branch other &&
- echo upstream >file &&
- git add file &&
- git commit -m upstream'
+test_expect_success 'setup' '
+ : >file &&
+ git add file &&
+ git commit -m initial &&
+ git branch other &&
+ echo upstream >file &&
+ git add file &&
+ git commit -m upstream
+'
-test_expect_success 'do not switch branches with dirty file' \
- 'git reset --hard &&
- git checkout other &&
- echo dirt >file &&
- git update-index --assume-unchanged file &&
- test_must_fail git checkout master'
+test_expect_success 'do not switch branches with dirty file' '
+ git reset --hard &&
+ git checkout other &&
+ echo dirt >file &&
+ git update-index --assume-unchanged file &&
+ test_must_fail git checkout - 2>err &&
+ test_i18ngrep overwritten err
+'
test_done