Skip to content

Commit 06df4ca

Browse files
committed
t2018: move checkout case-insensitive test from t0050
The test 'checkout with no pathspec and a case insensitive fs' in t0050 does not really belong there as it tests branch checkout behavior, not filesystem properties. It also had an unnecessary CASE_INSENSITIVE_FS prereq since the sequence of commands should succeed on any filesystem, and it did not verify the resulting worktree contents. Move it to t2018-checkout-branch.sh where it belongs, drop the prereq, and add a check that the expected file is present after the checkout. Signed-off-by: mdferdousalam <mdferdousalam1989@yahoo.com>
1 parent 7c02d39 commit 06df4ca

2 files changed

Lines changed: 21 additions & 20 deletions

File tree

t/t0050-filesystem.sh

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -117,24 +117,4 @@ $test_unicode 'merge (silent unicode normalization)' '
117117
git merge topic
118118
'
119119

120-
test_expect_success CASE_INSENSITIVE_FS 'checkout with no pathspec and a case insensitive fs' '
121-
git init repo &&
122-
(
123-
cd repo &&
124-
125-
>Gitweb &&
126-
git add Gitweb &&
127-
git commit -m "add Gitweb" &&
128-
129-
git checkout --orphan todo &&
130-
git reset --hard &&
131-
mkdir -p gitweb/subdir &&
132-
>gitweb/subdir/file &&
133-
git add gitweb &&
134-
git commit -m "add gitweb/subdir/file" &&
135-
136-
git checkout main
137-
)
138-
'
139-
140120
test_done

t/t2018-checkout-branch.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,4 +285,25 @@ test_expect_success 'checkout -b rejects an extra path argument' '
285285
test_grep "Cannot update paths and switch to branch" err
286286
'
287287

288+
test_expect_success 'checkout a branch when file and directory share case-insensitive name' '
289+
git init repo-case &&
290+
(
291+
cd repo-case &&
292+
293+
>Gitweb &&
294+
git add Gitweb &&
295+
git commit -m "add Gitweb" &&
296+
297+
git checkout --orphan other &&
298+
git reset --hard &&
299+
mkdir -p gitweb/subdir &&
300+
>gitweb/subdir/file &&
301+
git add gitweb &&
302+
git commit -m "add gitweb/subdir/file" &&
303+
304+
git checkout master &&
305+
test_path_is_file Gitweb
306+
)
307+
'
308+
288309
test_done

0 commit comments

Comments
 (0)