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>
This commit is contained in:
@ -99,6 +99,7 @@ origin_override=
|
|||||||
use_separate_remote=t
|
use_separate_remote=t
|
||||||
depth=
|
depth=
|
||||||
no_progress=
|
no_progress=
|
||||||
|
local_explicitly_asked_for=
|
||||||
test -t 1 || no_progress=--no-progress
|
test -t 1 || no_progress=--no-progress
|
||||||
while
|
while
|
||||||
case "$#,$1" in
|
case "$#,$1" in
|
||||||
@ -109,6 +110,7 @@ while
|
|||||||
*,--na|*,--nak|*,--nake|*,--naked|\
|
*,--na|*,--nak|*,--nake|*,--naked|\
|
||||||
*,-b|*,--b|*,--ba|*,--bar|*,--bare) bare=yes ;;
|
*,-b|*,--b|*,--ba|*,--bar|*,--bare) bare=yes ;;
|
||||||
*,-l|*,--l|*,--lo|*,--loc|*,--loca|*,--local)
|
*,-l|*,--l|*,--lo|*,--loc|*,--loca|*,--local)
|
||||||
|
local_explicitly_asked_for=yes
|
||||||
use_local_hardlink=yes ;;
|
use_local_hardlink=yes ;;
|
||||||
*,--no-h|*,--no-ha|*,--no-har|*,--no-hard|*,--no-hardl|\
|
*,--no-h|*,--no-ha|*,--no-har|*,--no-hard|*,--no-hardl|\
|
||||||
*,--no-hardli|*,--no-hardlin|*,--no-hardlink|*,--no-hardlinks)
|
*,--no-hardli|*,--no-hardlin|*,--no-hardlink|*,--no-hardlinks)
|
||||||
@ -281,7 +283,8 @@ yes)
|
|||||||
then
|
then
|
||||||
rm -f "$GIT_DIR/objects/sample"
|
rm -f "$GIT_DIR/objects/sample"
|
||||||
l=l
|
l=l
|
||||||
else
|
elif test -n "$local_explicitly_asked_for"
|
||||||
|
then
|
||||||
echo >&2 "Warning: -l asked but cannot hardlink to $repo"
|
echo >&2 "Warning: -l asked but cannot hardlink to $repo"
|
||||||
fi
|
fi
|
||||||
fi &&
|
fi &&
|
||||||
|
Reference in New Issue
Block a user