Skip to content

Commit 39f95df

Browse files
committed
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
2 parents e67fbf9 + b6e2a4f commit 39f95df

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

t/t2106-update-index-assume-unchanged.sh

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,23 @@ test_description='git update-index --assume-unchanged test.
55

66
. ./test-lib.sh
77

8-
test_expect_success 'setup' \
9-
': >file &&
10-
git add file &&
11-
git commit -m initial &&
12-
git branch other &&
13-
echo upstream >file &&
14-
git add file &&
15-
git commit -m upstream'
8+
test_expect_success 'setup' '
9+
: >file &&
10+
git add file &&
11+
git commit -m initial &&
12+
git branch other &&
13+
echo upstream >file &&
14+
git add file &&
15+
git commit -m upstream
16+
'
1617

17-
test_expect_success 'do not switch branches with dirty file' \
18-
'git reset --hard &&
19-
git checkout other &&
20-
echo dirt >file &&
21-
git update-index --assume-unchanged file &&
22-
test_must_fail git checkout master'
18+
test_expect_success 'do not switch branches with dirty file' '
19+
git reset --hard &&
20+
git checkout other &&
21+
echo dirt >file &&
22+
git update-index --assume-unchanged file &&
23+
test_must_fail git checkout - 2>err &&
24+
test_i18ngrep overwritten err
25+
'
2326

2427
test_done

0 commit comments

Comments
 (0)