Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
git-clone: check out "master" by default.
author
Junio C Hamano
<junkio@cox.net>
Tue, 27 Sep 2005 00:17:09 +0000
(17:17 -0700)
committer
Junio C Hamano
<junkio@cox.net>
Tue, 27 Sep 2005 01:04:17 +0000
(18:04 -0700)
And with -n flag you can tell it not to.
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-clone.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
152da3d
)
diff --git
a/git-clone.sh
b/git-clone.sh
index a322a459952cd28055f74b4ff1766407789dadf9..71431319c008fbc5771d97c4229e7054efd76395 100755
(executable)
--- a/
git-clone.sh
+++ b/
git-clone.sh
@@
-9,7
+9,7
@@
unset CDPATH
usage() {
unset CDPATH
usage() {
- echo >&2 "* git clone [-l [-s]] [-q] [-u <upload-pack>] <repo> <dir>"
+ echo >&2 "* git clone [-l [-s]] [-q] [-u <upload-pack>]
[-n]
<repo> <dir>"
exit 1
}
exit 1
}
@@
-61,10
+61,12
@@
Perhaps git-update-server-info needs to be run there?"
quiet=
use_local=no
local_shared=no
quiet=
use_local=no
local_shared=no
+no_checkout=
upload_pack=
while
case "$#,$1" in
0,*) break ;;
upload_pack=
while
case "$#,$1" in
0,*) break ;;
+ *,-n) no_checkout=yes ;;
*,-l|*,--l|*,--lo|*,--loc|*,--loca|*,--local) use_local=yes ;;
*,-s|*,--s|*,--sh|*,--sha|*,--shar|*,--share|*,--shared)
local_shared=yes ;;
*,-l|*,--l|*,--lo|*,--loc|*,--loca|*,--local) use_local=yes ;;
*,-s|*,--s|*,--sh|*,--sha|*,--shar|*,--share|*,--shared)
local_shared=yes ;;
@@
-186,9
+188,16
@@
yes,yes)
;;
esac
;;
esac
-# Update origin.
-mkdir -p "$D/.git/remotes/" &&
-rm -f "$D/.git/remotes/origin" &&
-echo >"$D/.git/remotes/origin" \
-"URL: $repo
+cd $D || exit
+
+if test -f ".git/HEAD"
+then
+ mkdir -p .git/remotes || exit
+ echo >.git/remotes/origin \
+ "URL: $repo
Pull: master:origin"
Pull: master:origin"
+ case "$no_checkout" in
+ '')
+ git checkout
+ esac
+fi