@matheusbsbs / matheus-bagliano / commits / a57c8bac00
Fork 0

Let git-clone to pass --template=dir option to git-init-db.

Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed May 28, 2006 at 10:14 UTC a57c8bac0021cec21027e25bd797f85b0abf9c81
2 files changed +15 -4
Documentation/git-clone.txt
+7 -2
@@ -9,8 +9,8 @@ git-clone - Clones a repository
9 SYNOPSIS
10 --------
11 [verse]
12 -'git-clone' [-l [-s]] [-q] [-n] [--bare] [-o <name>] [-u <upload-pack>]
13 - [--reference <repository>]
12 +'git-clone' [--template=<template_directory>] [-l [-s]] [-q] [-n] [--bare]
13 + [-o <name>] [-u <upload-pack>] [--reference <repository>]
14 <repository> [<directory>]
15
16 DESCRIPTION
@@ -89,6 +89,11 @@ OPTIONS
89 the command to specify non-default path for the command
90 run on the other end.
91
92 +--template=<template_directory>::
93 + Specify the directory from which templates will be used;
94 + if unset the templates are taken from the installation
95 + defined default, typically `/usr/share/git-core/templates`.
96 +
97 <repository>::
98 The (possibly remote) repository to clone from. It can
99 be any URL git-fetch supports.
git-clone.sh
+8 -2
@@ -9,7 +9,7 @@
9 unset CDPATH
10
11 usage() {
12 - echo >&2 "Usage: $0 [--use-separate-remote] [--reference <reference-repo>] [--bare] [-l [-s]] [-q] [-u <upload-pack>] [--origin <name>] [-n] <repo> [<dir>]"
12 + 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>]"
13 exit 1
14 }
15
@@ -102,6 +102,7 @@ quiet=
102 local=no
103 use_local=no
104 local_shared=no
105 +unset template
106 no_checkout=
107 upload_pack=
108 bare=
@@ -120,6 +121,11 @@ while
121 *,-l|*,--l|*,--lo|*,--loc|*,--loca|*,--local) use_local=yes ;;
122 *,-s|*,--s|*,--sh|*,--sha|*,--shar|*,--share|*,--shared)
123 local_shared=yes; use_local=yes ;;
124 + 1,--template) usage ;;
125 + *,--template)
126 + shift; template="--template=$1" ;;
127 + *,--template=*)
128 + template="$1" ;;
129 *,-q|*,--quiet) quiet=-q ;;
130 *,--use-separate-remote)
131 use_separate_remote=t ;;
@@ -203,7 +209,7 @@ trap 'err=$?; cd ..; rm -r "$D"; exit $err' 0
209 case "$bare" in
210 yes) GIT_DIR="$D" ;;
211 *) GIT_DIR="$D/.git" ;;
206 -esac && export GIT_DIR && git-init-db || usage
212 +esac && export GIT_DIR && git-init-db ${template+"$template"} || usage
213 case "$bare" in
214 yes)
215 GIT_DIR="$D" ;;