X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-init-db.c;h=baf0d09ac4ea372b4015d399560a133b401b55cc;hb=5521883490e85f4d973141972cf16f89a79f1979;hp=e23b8438c741651f48bbf529f89d0336cc718fed;hpb=bc9c3e0b932c5e14de749e07f5045197e7d6cd76;p=git.git diff --git a/builtin-init-db.c b/builtin-init-db.c index e23b8438c..baf0d09ac 100644 --- a/builtin-init-db.c +++ b/builtin-init-db.c @@ -115,18 +115,10 @@ static void copy_templates(const char *template_dir) if (!template_dir) template_dir = getenv(TEMPLATE_DIR_ENVIRONMENT); - if (!template_dir) { - /* - * if the hard-coded template is relative, it is - * interpreted relative to the exec_dir - */ - template_dir = DEFAULT_GIT_TEMPLATE_DIR; - if (!is_absolute_path(template_dir)) { - struct strbuf d = STRBUF_INIT; - strbuf_addf(&d, "%s/%s", git_exec_path(), template_dir); - template_dir = strbuf_detach(&d, NULL); - } - } + if (!template_dir) + template_dir = system_path(DEFAULT_GIT_TEMPLATE_DIR); + if (!template_dir[0]) + return; strcpy(template_path, template_dir); template_len = strlen(template_path); if (template_path[template_len-1] != '/') { @@ -364,7 +356,7 @@ static int guess_repository_type(const char *git_dir) } static const char init_db_usage[] = -"git-init [-q | --quiet] [--bare] [--template=] [--shared[=]]"; +"git init [-q | --quiet] [--bare] [--template=] [--shared[=]]"; /* * If you want to, you can share the DB area with any number of branches.