mirror of
https://github.com/git-for-windows/git.git
synced 2026-02-03 18:59:59 -06:00
t5605: special-case hardlink test for BusyBox-w32
When t5605 tries to verify that files are hardlinked (or that they are not), it uses the `-links` option of the `find` utility. BusyBox' implementation does not support that option, and BusyBox-w32's lstat() does not even report the number of hard links correctly (for performance reasons). So let's just switch to a different method that actually works on Windows. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
parent
4e3ac29bfb
commit
315c8725ea
@ -11,6 +11,21 @@ repo_is_hardlinked() {
|
|||||||
test_line_count = 0 output
|
test_line_count = 0 output
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if test_have_prereq MINGW,BUSYBOX
|
||||||
|
then
|
||||||
|
# BusyBox' `find` does not support `-links`. Besides, BusyBox-w32's
|
||||||
|
# lstat() does not report hard links, just like Git's mingw_lstat()
|
||||||
|
# (from where BusyBox-w32 got its initial implementation).
|
||||||
|
repo_is_hardlinked() {
|
||||||
|
for f in $(find "$1/objects" -type f)
|
||||||
|
do
|
||||||
|
"$SYSTEMROOT"/system32/fsutil.exe \
|
||||||
|
hardlink list $f >links &&
|
||||||
|
test_line_count -gt 1 links || return 1
|
||||||
|
done
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
test_expect_success 'preparing origin repository' '
|
test_expect_success 'preparing origin repository' '
|
||||||
: >file && git add . && git commit -m1 &&
|
: >file && git add . && git commit -m1 &&
|
||||||
git clone --bare . a.git &&
|
git clone --bare . a.git &&
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user