From a57c8bac0021cec21027e25bd797f85b0abf9c81 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 28 May 2006 10:14:38 -0700 Subject: [PATCH] Let git-clone to pass --template=dir option to git-init-db. Signed-off-by: Junio C Hamano --- Documentation/git-clone.txt | 9 +++++++-- git-clone.sh | 10 ++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt index b333f510..94d93933 100644 --- a/Documentation/git-clone.txt +++ b/Documentation/git-clone.txt @@ -9,8 +9,8 @@ git-clone - Clones a repository SYNOPSIS -------- [verse] -'git-clone' [-l [-s]] [-q] [-n] [--bare] [-o ] [-u ] - [--reference ] +'git-clone' [--template=] [-l [-s]] [-q] [-n] [--bare] + [-o ] [-u ] [--reference ] [] DESCRIPTION @@ -89,6 +89,11 @@ OPTIONS the command to specify non-default path for the command run on the other end. +--template=:: + Specify the directory from which templates will be used; + if unset the templates are taken from the installation + defined default, typically `/usr/share/git-core/templates`. + :: The (possibly remote) repository to clone from. It can be any URL git-fetch supports. diff --git a/git-clone.sh b/git-clone.sh index d96894d4..de59904d 100755 --- a/git-clone.sh +++ b/git-clone.sh @@ -9,7 +9,7 @@ unset CDPATH usage() { - echo >&2 "Usage: $0 [--use-separate-remote] [--reference ] [--bare] [-l [-s]] [-q] [-u ] [--origin ] [-n] []" + echo >&2 "Usage: $0 [--template=] [--use-separate-remote] [--reference ] [--bare] [-l [-s]] [-q] [-u ] [--origin ] [-n] []" 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" ;; -- 2.11.0