@matheusbsbs / matheus-bagliano / commits / 23d53358be
Fork 0

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>

Junio C Hamano committed Aug 20, 2007 at 15:35 UTC 23d53358be51bb256699f4d237619a3ee8addf39
1 file changed +4 -1
git-clone.sh
+4 -1
@@ -99,6 +99,7 @@ origin_override=
99 use_separate_remote=t
100 depth=
101 no_progress=
102 +local_explicitly_asked_for=
103 test -t 1 || no_progress=--no-progress
104 while
105 case "$#,$1" in
@@ -109,6 +110,7 @@ while
110 *,--na|*,--nak|*,--nake|*,--naked|\
111 *,-b|*,--b|*,--ba|*,--bar|*,--bare) bare=yes ;;
112 *,-l|*,--l|*,--lo|*,--loc|*,--loca|*,--local)
113 + local_explicitly_asked_for=yes
114 use_local_hardlink=yes ;;
115 *,--no-h|*,--no-ha|*,--no-har|*,--no-hard|*,--no-hardl|\
116 *,--no-hardli|*,--no-hardlin|*,--no-hardlink|*,--no-hardlinks)
@@ -281,7 +283,8 @@ yes)
283 then
284 rm -f "$GIT_DIR/objects/sample"
285 l=l
284 - else
286 + elif test -n "$local_explicitly_asked_for"
287 + then
288 echo >&2 "Warning: -l asked but cannot hardlink to $repo"
289 fi
290 fi &&