Skip to content

Commit 23d5335

Browse files
committed
git clone: do not issue warning while cloning locally across filesystems
Unless the user explicitly asked hardlinking with the '-l' option, we should not say "oops we cannot hardlink as you asked so we are copying". Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 2be7fcb commit 23d5335

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

git-clone.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ origin_override=
9999
use_separate_remote=t
100100
depth=
101101
no_progress=
102+
local_explicitly_asked_for=
102103
test -t 1 || no_progress=--no-progress
103104
while
104105
case "$#,$1" in
@@ -109,6 +110,7 @@ while
109110
*,--na|*,--nak|*,--nake|*,--naked|\
110111
*,-b|*,--b|*,--ba|*,--bar|*,--bare) bare=yes ;;
111112
*,-l|*,--l|*,--lo|*,--loc|*,--loca|*,--local)
113+
local_explicitly_asked_for=yes
112114
use_local_hardlink=yes ;;
113115
*,--no-h|*,--no-ha|*,--no-har|*,--no-hard|*,--no-hardl|\
114116
*,--no-hardli|*,--no-hardlin|*,--no-hardlink|*,--no-hardlinks)
@@ -281,7 +283,8 @@ yes)
281283
then
282284
rm -f "$GIT_DIR/objects/sample"
283285
l=l
284-
else
286+
elif test -n "$local_explicitly_asked_for"
287+
then
285288
echo >&2 "Warning: -l asked but cannot hardlink to $repo"
286289
fi
287290
fi &&

0 commit comments

Comments
 (0)