Skip to content

Commit 3e7af43

Browse files
committed
Merge pull request git-for-windows#1859 from dscho/funny-cased-cwd
Fix t0001 when the current working directory differs in case from the canonical form
2 parents b6b88d0 + 093fdc1 commit 3e7af43

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

t/t0001-init.sh

+12
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,20 @@ test_expect_success 'init prefers command line to GIT_DIR' '
307307
test_path_is_missing otherdir/refs
308308
'
309309

310+
downcase_on_case_insensitive_fs () {
311+
test false = "$(git config --get core.filemode)" || return 0
312+
for f
313+
do
314+
tr A-Z a-z <"$f" >"$f".downcased &&
315+
mv -f "$f".downcased "$f" || return 1
316+
done
317+
}
318+
310319
test_expect_success 'init with separate gitdir' '
311320
rm -rf newdir &&
312321
git init --separate-git-dir realgitdir newdir &&
313322
echo "gitdir: $(pwd)/realgitdir" >expected &&
323+
downcase_on_case_insensitive_fs expected newdir/.git &&
314324
test_cmp expected newdir/.git &&
315325
test_path_is_dir realgitdir/refs
316326
'
@@ -365,6 +375,7 @@ test_expect_success 're-init to update git link' '
365375
git init --separate-git-dir ../surrealgitdir
366376
) &&
367377
echo "gitdir: $(pwd)/surrealgitdir" >expected &&
378+
downcase_on_case_insensitive_fs expected newdir/.git &&
368379
test_cmp expected newdir/.git &&
369380
test_path_is_dir surrealgitdir/refs &&
370381
test_path_is_missing realgitdir/refs
@@ -378,6 +389,7 @@ test_expect_success 're-init to move gitdir' '
378389
git init --separate-git-dir ../realgitdir
379390
) &&
380391
echo "gitdir: $(pwd)/realgitdir" >expected &&
392+
downcase_on_case_insensitive_fs expected newdir/.git &&
381393
test_cmp expected newdir/.git &&
382394
test_path_is_dir realgitdir/refs
383395
'

0 commit comments

Comments
 (0)