summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 152da3d)
raw | patch | inline | side by side (parent: 152da3d)
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>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-clone.sh | patch | blob | history |
diff --git a/git-clone.sh b/git-clone.sh
index a322a459952cd28055f74b4ff1766407789dadf9..71431319c008fbc5771d97c4229e7054efd76395 100755 (executable)
--- a/git-clone.sh
+++ b/git-clone.sh
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
}
quiet=
use_local=no
local_shared=no
+no_checkout=
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 ;;
;;
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"
+ case "$no_checkout" in
+ '')
+ git checkout
+ esac
+fi