Merge branch 'ar/clone'
authorJunio C Hamano <gitster@pobox.com>
Sat, 9 Jun 2007 04:03:04 +0000 (21:03 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 9 Jun 2007 04:03:04 +0000 (21:03 -0700)
* ar/clone:
Fix clone to setup the origin if its name ends with .git

1  2 
git-clone.sh
diff --combined git-clone.sh
index 5bfd8d1556bb7d0da0beaf3685b2350af20e1e15,d45618d9afe203d103cb6cdcbd66e23b0dc42932..3a410624d374e9d02b305a25469176e4d4e725e6
@@@ -2,7 -2,7 +2,7 @@@
  #
  # Copyright (c) 2005, Linus Torvalds
  # Copyright (c) 2005, Junio C Hamano
 -# 
 +#
  # Clone a repository into a different directory that does not yet exist.
  
  # See git-sh-setup why.
@@@ -20,7 -20,7 +20,7 @@@ usage() 
  get_repo_base() {
        (
                cd "`/bin/pwd`" &&
-               cd "$1" &&
+               cd "$1" || cd "$1.git" &&
                {
                        cd .git
                        pwd
@@@ -98,7 -98,7 +98,7 @@@ whil
        *,--na|*,--nak|*,--nake|*,--naked|\
        *,-b|*,--b|*,--ba|*,--bar|*,--bare) bare=yes ;;
        *,-l|*,--l|*,--lo|*,--loc|*,--loca|*,--local) use_local=yes ;;
 -        *,-s|*,--s|*,--sh|*,--sha|*,--shar|*,--share|*,--shared) 
 +        *,-s|*,--s|*,--sh|*,--sha|*,--shar|*,--share|*,--shared)
            local_shared=yes; use_local=yes ;;
        1,--template) usage ;;
        *,--template)
@@@ -410,3 -410,4 +410,3 @@@ f
  rm -f "$GIT_DIR/CLONE_HEAD" "$GIT_DIR/REMOTE_HEAD"
  
  trap - 0
 -