'
test_expect_success 'absolute pathname' '(
-
rm -fr mine &&
mkdir mine &&
cd mine &&
! test -d sub &&
test -d in &&
git ls-files --error-unmatch in/file
-
-
)'
test_expect_success 'absolute pathname outside should fail' '(
-
rm -fr mine &&
mkdir mine &&
cd mine &&
test -d sub &&
! test -d ../in &&
git ls-files --error-unmatch sub/file
-
)'
test_expect_success 'git mv to move multiple sources into a directory' '
'
test_expect_success 'git mv should not change sha1 of moved cache entry' '
-
rm -fr .git &&
git init &&
echo 1 >dirty &&
echo 2 >dirty2 &&
git mv dirty2 dirty &&
[ "$entry" = "$(git ls-files --stage dirty | cut -f 1)" ]
-
'
rm -f dirty dirty2
'
test_expect_success 'git mv should overwrite symlink to a file' '
-
rm -fr .git &&
git init &&
echo 1 >moved &&
test "$(cat symlink)" = 1 &&
git update-index --refresh &&
git diff-files --quiet
-
'
rm -f moved symlink
test_expect_success 'git mv should overwrite file with a symlink' '
-
rm -fr .git &&
git init &&
echo 1 >moved &&
! test -e symlink &&
git update-index --refresh &&
git diff-files --quiet
-
'
test_expect_success SYMLINKS 'check moved symlink' '
-
test -h moved
'