* js/test-ln-s-add:
t4011: remove SYMLINKS prerequisite
t6035: use test_ln_s_add to remove SYMLINKS prerequisite
t3509, t4023, t4114: use test_ln_s_add to remove SYMLINKS prerequisite
t3100: use test_ln_s_add to remove SYMLINKS prerequisite
t3030: use test_ln_s_add to remove SYMLINKS prerequisite
t0000: use test_ln_s_add to remove SYMLINKS prerequisite
tests: use test_ln_s_add to remove SYMLINKS prerequisite (trivial cases)
tests: introduce test_ln_s_add
t3010: modernize style
test-chmtime: Fix exit code on Windows
@ -367,22 +367,6 @@ test_expect_success 'validate object ID of a known tree' '
@@ -367,22 +367,6 @@ test_expect_success 'validate object ID of a known tree' '
# Various types of objects
# Some filesystems do not support symblic links; on such systems
@ -390,10 +374,7 @@ test_expect_success 'adding various types of objects with git update-index --add
@@ -390,10 +374,7 @@ test_expect_success 'adding various types of objects with git update-index --add
@ -423,14 +404,14 @@ test_expect_success 'writing tree out with git write-tree' '
@@ -423,14 +404,14 @@ test_expect_success 'writing tree out with git write-tree' '
'
test_expect_success 'validate object ID for a known tree' '
test "$tree" = "$expectedtree"
test "$tree" = 087704a96baf1c2d1c869a8b084481e121c88b5b
'
test_expect_success 'showing tree with git ls-tree' '
git ls-tree $tree >current
'
test_expect_success SYMLINKS 'git ls-tree output for a known tree' '
test_expect_success 'git ls-tree output for a known tree' '
@ -487,7 +468,7 @@ test_expect_success 'writing partial tree out with git write-tree --prefix' '
@@ -487,7 +468,7 @@ test_expect_success 'writing partial tree out with git write-tree --prefix' '
'
test_expect_success 'validate object ID for a known tree' '
test "$ptree" = "$expectedptree1"
test "$ptree" = 21ae8269cacbe57ae09138dcc3a2887f904d02b3
'
test_expect_success 'writing partial tree out with git write-tree --prefix' '
@ -495,7 +476,7 @@ test_expect_success 'writing partial tree out with git write-tree --prefix' '
@@ -495,7 +476,7 @@ test_expect_success 'writing partial tree out with git write-tree --prefix' '
'
test_expect_success 'validate object ID for a known tree' '
test "$ptree" = "$expectedptree2"
test "$ptree" = 3c5e5399f3a333eddecce7a9b9465b63f65f51e2
'
test_expect_success 'put invalid objects into the index' '
@ -529,7 +510,7 @@ test_expect_success 'git read-tree followed by write-tree should be idempotent'
@@ -529,7 +510,7 @@ test_expect_success 'git read-tree followed by write-tree should be idempotent'
'
test_expect_success 'validate git diff-files output for a know cache/work tree state' '
$expectfilter >expected <<\EOF &&
cat >expected <<\EOF &&
:100644 100644 f87290f8eb2cbbea7857214459a0739927eab154 0000000000000000000000000000000000000000 M path0
:120000 120000 15a98433ae33114b085f3eb3bb03b832b3180a01 0000000000000000000000000000000000000000 M path0sym
:100644 100644 3feff949ed00a62d9f7af97c15cd8a30595e7ac7 0000000000000000000000000000000000000000 M path2/file2
@ -553,7 +534,7 @@ test_expect_success 'no diff after checkout and git update-index --refresh' '
@@ -553,7 +534,7 @@ test_expect_success 'no diff after checkout and git update-index --refresh' '
@ -6,7 +6,7 @@ test_description='git checkout to switch between branches with symlink<->dir'
@@ -6,7 +6,7 @@ test_description='git checkout to switch between branches with symlink<->dir'
@ -29,21 +29,25 @@ test_expect_success 'checkout commit with dir must not remove untracked a/b' '
@@ -29,21 +29,25 @@ test_expect_success 'checkout commit with dir must not remove untracked a/b' '
test -f a/b
'
test_expect_success SYMLINKS 'create a commit where dir a/b changed to symlink' '
test_expect_success 'create a commit where dir a/b changed to symlink' '
rm -rf a/b && # cleanup if previous test failed
git checkout -f -b symlink start &&
rm -rf a/b &&
ln -s foo a/b &&
git add -A &&
test_ln_s_add foo a/b &&
git commit -m "dir to symlink"
'
test_expect_success SYMLINKS 'checkout commit with dir must not remove untracked a/b' '
test_expect_success 'checkout commit with dir must not remove untracked a/b' '
git rm --cached a/b &&
git commit -m "un-track the symlink" &&
test_must_fail git checkout start &&
test_must_fail git checkout start
'
test_expect_success SYMLINKS 'the symlink remained' '
test_expect_success SYMLINKS 'diff identical, but newly created symlink and file' '
test_expect_success 'diff identical, but newly created symlink and file' '
>expected &&
rm -f frotz nitfol &&
echo xyzzy >nitfol &&
test-chmtime +10 nitfol &&
ln -s xyzzy frotz &&
if test_have_prereq SYMLINKS
then
ln -s xyzzy frotz
else
printf xyzzy >frotz
# the symlink property propagates from the index
fi &&
git diff-index -M -p $tree >current &&
compare_diff_patch expected current &&
@ -80,7 +89,7 @@ test_expect_success SYMLINKS 'diff identical, but newly created symlink and file
@@ -80,7 +89,7 @@ test_expect_success SYMLINKS 'diff identical, but newly created symlink and file
compare_diff_patch expected current
'
test_expect_success SYMLINKS 'diff different symlink and file' '
test_expect_success 'diff different symlink and file' '
cat >expected <<-\EOF &&
diff --git a/frotz b/frotz
index 7c465af..df1db54 120000
@ -100,7 +109,13 @@ test_expect_success SYMLINKS 'diff different symlink and file' '
@@ -100,7 +109,13 @@ test_expect_success SYMLINKS 'diff different symlink and file' '
test_expect_success SYMLINKS 'cross renames to be detected for regular files' '
test_expect_success 'cross renames to be detected for regular files' '
git diff-tree five six -r --name-status -B -M | sort >actual &&
{
@ -61,7 +61,7 @@ test_expect_success SYMLINKS 'cross renames to be detected for regular files' '
@@ -61,7 +61,7 @@ test_expect_success SYMLINKS 'cross renames to be detected for regular files' '
'
test_expect_success SYMLINKS 'cross renames to be detected for typechange' '
test_expect_success 'cross renames to be detected for typechange' '
git diff-tree one two -r --name-status -B -M | sort >actual &&
{
@ -72,7 +72,7 @@ test_expect_success SYMLINKS 'cross renames to be detected for typechange' '
@@ -72,7 +72,7 @@ test_expect_success SYMLINKS 'cross renames to be detected for typechange' '
'
test_expect_success SYMLINKS 'moves and renames' '
test_expect_success 'moves and renames' '
git diff-tree three four -r --name-status -B -M | sort >actual &&
@ -9,20 +9,19 @@ test_description='git apply should not get confused with type changes.
@@ -9,20 +9,19 @@ test_description='git apply should not get confused with type changes.
. ./test-lib.sh
test_expect_success SYMLINKS 'setup repository and commits' '
test_expect_success 'setup repository and commits' '
test_description='merging when a directory was replaced with a symlink'
. ./test-lib.sh
test_expect_success SYMLINKS 'create a commit where dir a/b changed to symlink' '
test_expect_success 'create a commit where dir a/b changed to symlink' '
mkdir -p a/b/c a/b-2/c &&
> a/b/c/d &&
> a/b-2/c/d &&
@ -12,12 +12,12 @@ test_expect_success SYMLINKS 'create a commit where dir a/b changed to symlink'
@@ -12,12 +12,12 @@ test_expect_success SYMLINKS 'create a commit where dir a/b changed to symlink'
git commit -m base &&
git tag start &&
rm -rf a/b &&
ln -s b-2 a/b &&
git add -A &&
test_ln_s_add b-2 a/b &&
git commit -m "dir to symlink"
'
test_expect_success SYMLINKS 'checkout does not clobber untracked symlink' '
test_expect_success 'checkout does not clobber untracked symlink' '
git checkout HEAD^0 &&
git reset --hard master &&
git rm --cached a/b &&
@ -25,7 +25,7 @@ test_expect_success SYMLINKS 'checkout does not clobber untracked symlink' '
@@ -25,7 +25,7 @@ test_expect_success SYMLINKS 'checkout does not clobber untracked symlink' '
test_must_fail git checkout start^0
'
test_expect_success SYMLINKS 'a/b-2/c/d is kept when clobbering symlink b' '
test_expect_success 'a/b-2/c/d is kept when clobbering symlink b' '
git checkout HEAD^0 &&
git reset --hard master &&
git rm --cached a/b &&
@ -34,14 +34,14 @@ test_expect_success SYMLINKS 'a/b-2/c/d is kept when clobbering symlink b' '
@@ -34,14 +34,14 @@ test_expect_success SYMLINKS 'a/b-2/c/d is kept when clobbering symlink b' '
test -f a/b-2/c/d
'
test_expect_success SYMLINKS 'checkout should not have deleted a/b-2/c/d' '
test_expect_success 'checkout should not have deleted a/b-2/c/d' '
git checkout HEAD^0 &&
git reset --hard master &&
git checkout start^0 &&
test -f a/b-2/c/d
'
test_expect_success SYMLINKS 'setup for merge test' '
@ -218,13 +218,13 @@ test_expect_success 'git mv should not change sha1 of moved cache entry' '
@@ -218,13 +218,13 @@ test_expect_success 'git mv should not change sha1 of moved cache entry' '
rm -f dirty dirty2
test_expect_success SYMLINKS 'git mv should overwrite symlink to a file' '
test_expect_success 'git mv should overwrite symlink to a file' '
rm -fr .git &&
git init &&
echo 1 >moved &&
ln -s moved symlink &&
git add moved symlink &&
test_ln_s_add moved symlink &&
git add moved &&
test_must_fail git mv moved symlink &&
git mv -f moved symlink &&
! test -e moved &&
@ -237,22 +237,26 @@ test_expect_success SYMLINKS 'git mv should overwrite symlink to a file' '
@@ -237,22 +237,26 @@ test_expect_success SYMLINKS 'git mv should overwrite symlink to a file' '
rm -f moved symlink
test_expect_success SYMLINKS 'git mv should overwrite file with a symlink' '
test_expect_success 'git mv should overwrite file with a symlink' '
rm -fr .git &&
git init &&
echo 1 >moved &&
ln -s moved symlink &&
git add moved symlink &&
test_ln_s_add moved symlink &&
git add moved &&
test_must_fail git mv symlink moved &&
git mv -f symlink moved &&
! test -e symlink &&
test -h moved &&
git update-index --refresh &&
git diff-files --quiet
'
test_expect_success SYMLINKS 'check moved symlink' '
@ -141,11 +141,10 @@ test_expect_success SYMLINKS 'will not overwrite untracked symlink in leading pa
@@ -141,11 +141,10 @@ test_expect_success SYMLINKS 'will not overwrite untracked symlink in leading pa
test_path_is_missing .git/MERGE_HEAD
'
test_expect_success SYMLINKS 'will not be confused by symlink in leading path' '
test_expect_success 'will not be confused by symlink in leading path' '