Re: Suprising error message from "git clone"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Matthieu Moy <Matthieu.Moy@xxxxxxx> writes:

> I got a suprising error message:
>
> $ cd /tmp/
> $ git clone ~/some/repository
> Initialized empty Git repository in /tmp/repository/.git/
> Warning: -l asked but cannot hardlink to /home/moy/some/repository/.git

Yup, we already discussed when we switched to defaulting to -l,
but nobody cared enough to get around to patch the warning.

Untested but something like this should suffice...

By the way, could you possibly drop Mail-Followup-To: please?

 git-clone.sh |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/git-clone.sh b/git-clone.sh
index e4a9ac4..18003ab 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -99,6 +99,7 @@ origin_override=
 use_separate_remote=t
 depth=
 no_progress=
+local_explicitly_asked_for=
 test -t 1 || no_progress=--no-progress
 while
 	case "$#,$1" in
@@ -109,6 +110,7 @@ while
 	*,--na|*,--nak|*,--nake|*,--naked|\
 	*,-b|*,--b|*,--ba|*,--bar|*,--bare) bare=yes ;;
 	*,-l|*,--l|*,--lo|*,--loc|*,--loca|*,--local)
+	  local_explicitly_asked_for=yes
 	  use_local_hardlink=yes ;;
 	*,--no-h|*,--no-ha|*,--no-har|*,--no-hard|*,--no-hardl|\
 	*,--no-hardli|*,--no-hardlin|*,--no-hardlink|*,--no-hardlinks)
@@ -281,7 +283,8 @@ yes)
 			then
 				rm -f "$GIT_DIR/objects/sample"
 				l=l
-			else
+			elif test -n "$local_explicitly_asked_for"
+			then
 				echo >&2 "Warning: -l asked but cannot hardlink to $repo"
 			fi
 		fi &&
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux