mirror of
https://github.com/git/git.git
synced 2026-03-13 18:33:25 +01:00
Hardlinks are not supported in MSys so we disable them.
We do not want the default to be hardlinks for local clones and we show a warning if the user tries to use -l. Signed-off-by: Mike Pape <dotzenlabs@gmail.com>
This commit is contained in:
9
Makefile
9
Makefile
@@ -39,6 +39,9 @@ all:
|
||||
# Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link.
|
||||
# Enable it on Windows. By default, symrefs are still used.
|
||||
#
|
||||
# Define NO_HARDLINKS if you want to disable hard linking in git clone.
|
||||
# Enable it on Windows.
|
||||
#
|
||||
# Define NO_SVN_TESTS if you want to skip time-consuming SVN interoperability
|
||||
# tests. These tests take up a significant amount of the total test time
|
||||
# but are not needed unless you plan to talk to SVN repos.
|
||||
@@ -482,6 +485,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
|
||||
NO_PREAD=YesPlease
|
||||
NO_OPENSSL=YesPlease
|
||||
NO_SYMLINK_HEAD=YesPlease
|
||||
NO_HARDLINKS=YesPlease
|
||||
NO_IPV6=YesPlease
|
||||
NO_ETC_PASSWD=YesPlease
|
||||
NO_SETENV=YesPlease
|
||||
@@ -724,6 +728,10 @@ ifdef ASCIIDOC8
|
||||
export ASCIIDOC8
|
||||
endif
|
||||
|
||||
ifdef NO_HARDLINKS
|
||||
export NO_HARDLINKS
|
||||
endif
|
||||
|
||||
# Shell quote (do not use $(call) to accommodate ancient setups);
|
||||
|
||||
SHA1_HEADER_SQ = $(subst ','\'',$(SHA1_HEADER))
|
||||
@@ -799,6 +807,7 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
|
||||
-e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
|
||||
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
|
||||
-e 's/@@NO_CURL@@/$(NO_CURL)/g' \
|
||||
-e 's/@@NO_HARDLINKS@@/$(NO_HARDLINKS)/g' \
|
||||
$@.sh >$@+ && \
|
||||
chmod +x $@+ && \
|
||||
mv $@+ $@
|
||||
|
||||
@@ -99,6 +99,7 @@ origin_override=
|
||||
use_separate_remote=t
|
||||
depth=
|
||||
no_progress=
|
||||
test "@@NO_HARDLINKS@@" && use_local_hardlink=no
|
||||
test -t 1 || no_progress=--no-progress
|
||||
while
|
||||
case "$#,$1" in
|
||||
@@ -109,7 +110,9 @@ while
|
||||
*,--na|*,--nak|*,--nake|*,--naked|\
|
||||
*,-b|*,--b|*,--ba|*,--bar|*,--bare) bare=yes ;;
|
||||
*,-l|*,--l|*,--lo|*,--loc|*,--loca|*,--local)
|
||||
use_local_hardlink=yes ;;
|
||||
(test "@@NO_HARDLINKS@@" &&
|
||||
echo >&2 "Warning: -l asked but hardlinks are not supported") ||
|
||||
use_local_hardlink=yes ;;
|
||||
*,--no-h|*,--no-ha|*,--no-har|*,--no-hard|*,--no-hardl|\
|
||||
*,--no-hardli|*,--no-hardlin|*,--no-hardlink|*,--no-hardlinks)
|
||||
use_local_hardlink=no ;;
|
||||
|
||||
@@ -18,6 +18,10 @@ ifdef NO_SYMLINKS
|
||||
GIT_TEST_OPTS += --no-symlinks
|
||||
endif
|
||||
|
||||
ifdef NO_HARDLINKS
|
||||
GIT_TEST_OPTS += --no-hardlinks
|
||||
endif
|
||||
|
||||
all: $(T) clean
|
||||
|
||||
$(T):
|
||||
|
||||
@@ -3,6 +3,13 @@
|
||||
test_description='test local clone'
|
||||
. ./test-lib.sh
|
||||
|
||||
if test "$no_hardlinks"
|
||||
then
|
||||
say 'Hard links not supported, skipping tests.'
|
||||
test_done
|
||||
exit
|
||||
fi
|
||||
|
||||
D=`pwd`
|
||||
|
||||
test_expect_success 'preparing origin repository' '
|
||||
|
||||
@@ -89,6 +89,8 @@ do
|
||||
shift ;;
|
||||
--no-symlinks)
|
||||
no_symlinks=t; shift ;;
|
||||
--no-hardlinks)
|
||||
no_hardlinks=t; shift ;;
|
||||
*)
|
||||
break ;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user