Skip to content

Commit

Permalink
Merge pull request #1859 from dscho/funny-cased-cwd
Browse files Browse the repository at this point in the history
Fix t0001 when the current working directory differs in case from the canonical form
  • Loading branch information
dscho authored and Git for Windows Build Agent committed Jun 8, 2019
2 parents b3f2dad + e767708 commit 213f886
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions t/t0001-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,20 @@ test_expect_success 'init prefers command line to GIT_DIR' '
test_path_is_missing otherdir/refs
'

downcase_on_case_insensitive_fs () {
test false = "$(git config --get core.filemode)" || return 0
for f
do
tr A-Z a-z <"$f" >"$f".downcased &&
mv -f "$f".downcased "$f" || return 1
done
}

test_expect_success 'init with separate gitdir' '
rm -rf newdir &&
git init --separate-git-dir realgitdir newdir &&
echo "gitdir: $(pwd)/realgitdir" >expected &&
downcase_on_case_insensitive_fs expected newdir/.git &&
test_cmp expected newdir/.git &&
test_path_is_dir realgitdir/refs
'
Expand Down Expand Up @@ -366,6 +376,7 @@ test_expect_success 're-init to update git link' '
git init --separate-git-dir ../surrealgitdir
) &&
echo "gitdir: $(pwd)/surrealgitdir" >expected &&
downcase_on_case_insensitive_fs expected newdir/.git &&
test_cmp expected newdir/.git &&
test_path_is_dir surrealgitdir/refs &&
test_path_is_missing realgitdir/refs
Expand All @@ -379,6 +390,7 @@ test_expect_success 're-init to move gitdir' '
git init --separate-git-dir ../realgitdir
) &&
echo "gitdir: $(pwd)/realgitdir" >expected &&
downcase_on_case_insensitive_fs expected newdir/.git &&
test_cmp expected newdir/.git &&
test_path_is_dir realgitdir/refs
'
Expand Down

0 comments on commit 213f886

Please sign in to comment.