diff options
author | Junio C Hamano <junkio@cox.net> | 2006-05-28 10:14:38 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-05-28 10:14:38 -0700 |
commit | a57c8bac0021cec21027e25bd797f85b0abf9c81 (patch) | |
tree | 386045d9d30b5941b24e47dea70ab7e5548af8e2 /git-clone.sh | |
parent | 3f0f756b839c5f426fcd85c2b5d09164392b8bf6 (diff) | |
download | git-a57c8bac0021cec21027e25bd797f85b0abf9c81.tar.gz git-a57c8bac0021cec21027e25bd797f85b0abf9c81.tar.xz |
Let git-clone to pass --template=dir option to git-init-db.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-clone.sh')
-rwxr-xr-x | git-clone.sh | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/git-clone.sh b/git-clone.sh index d96894d4c..de59904d5 100755 --- a/git-clone.sh +++ b/git-clone.sh @@ -9,7 +9,7 @@ unset CDPATH usage() { - echo >&2 "Usage: $0 [--use-separate-remote] [--reference <reference-repo>] [--bare] [-l [-s]] [-q] [-u <upload-pack>] [--origin <name>] [-n] <repo> [<dir>]" + echo >&2 "Usage: $0 [--template=<template_directory>] [--use-separate-remote] [--reference <reference-repo>] [--bare] [-l [-s]] [-q] [-u <upload-pack>] [--origin <name>] [-n] <repo> [<dir>]" exit 1 } @@ -102,6 +102,7 @@ quiet= local=no use_local=no local_shared=no +unset template no_checkout= upload_pack= bare= @@ -120,6 +121,11 @@ while *,-l|*,--l|*,--lo|*,--loc|*,--loca|*,--local) use_local=yes ;; *,-s|*,--s|*,--sh|*,--sha|*,--shar|*,--share|*,--shared) local_shared=yes; use_local=yes ;; + 1,--template) usage ;; + *,--template) + shift; template="--template=$1" ;; + *,--template=*) + template="$1" ;; *,-q|*,--quiet) quiet=-q ;; *,--use-separate-remote) use_separate_remote=t ;; @@ -203,7 +209,7 @@ trap 'err=$?; cd ..; rm -r "$D"; exit $err' 0 case "$bare" in yes) GIT_DIR="$D" ;; *) GIT_DIR="$D/.git" ;; -esac && export GIT_DIR && git-init-db || usage +esac && export GIT_DIR && git-init-db ${template+"$template"} || usage case "$bare" in yes) GIT_DIR="$D" ;; |