Skip to content

Commit 817d03e

Browse files
j6tgitster
authored andcommitted
test_ln_s_add: refresh stat info of fake symbolic links
We have a helper function test_ln_s_add that inserts a symbolic link into the index even if the file system does not support symbolic links. There is a small flaw in the emulation path: the added entry does not pick up stat information of the fake symbolic link from the file system, as a consequence, the index is not exactly the same as for the "regular" path (where symbolic links are available). To fix this, just call git update-index again. This flaw was revealed by the earlier change that tightened compare_diff_raw(), because a test case in t4008 depends on the correctly updated index. Signed-off-by: Johannes Sixt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent db7b9e3 commit 817d03e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

t/test-lib-functions.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,9 @@ test_ln_s_add () {
707707
else
708708
printf '%s' "$1" >"$2" &&
709709
ln_s_obj=$(git hash-object -w "$2") &&
710-
git update-index --add --cacheinfo 120000 $ln_s_obj "$2"
710+
git update-index --add --cacheinfo 120000 $ln_s_obj "$2" &&
711+
# pick up stat info from the file
712+
git update-index "$2"
711713
fi
712714
}
713715

0 commit comments

Comments
 (0)