summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-02-14 17:51:49 +0700
committerJunio C Hamano <gitster@pobox.com>2018-02-14 10:21:44 -0800
commit5718959ee7db9b2c748d2c58d9d28d9687fcd371 (patch)
treec74779d80cffec2078aa2723639778ff2f0f409f
parentf812cd94a2c31a059f44d1c98db0287af1295b39 (diff)
downloadgit-nd/tilde-expand-opt-file-value.tar.gz
init-db: change --template type to OPTION_FILENAMEnd/tilde-expand-opt-file-value
OPTION_FILENAME has some magic behind the scene, like prefixing which is useless for init-db. The $HOME expansion though does come handy and makes --template more consistent with the rest (both env and config var get $HOME expansion). Noticed-by: Doron Behar <doron.behar@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin/init-db.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/init-db.c b/builtin/init-db.c
index c9b7946bad..081b629999 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -473,8 +473,9 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
const char *template_dir = NULL;
unsigned int flags = 0;
const struct option init_db_options[] = {
- OPT_STRING(0, "template", &template_dir, N_("template-directory"),
- N_("directory from which templates will be used")),
+ { OPTION_FILENAME, 0, "template", &template_dir,
+ N_("template-directory"),
+ N_("directory from which templates will be used")},
OPT_SET_INT(0, "bare", &is_bare_repository_cfg,
N_("create a bare repository"), 1),
{ OPTION_CALLBACK, 0, "shared", &init_shared_repository,