summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-07-25 21:27:06 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-07-25 21:27:06 (GMT)
commit35d771591f673e1c2c7bc90b998670bed1e9e567 (patch)
tree33e4d257ec09ef3cebdb8dd94ce3251993b9b3a1 /builtin
parentb697d92f56511e804b8ba20ccbe7bdc85dc66810 (diff)
parente1df7fe43f4e2e607ed24668e2942d45df8d2743 (diff)
downloadgit-35d771591f673e1c2c7bc90b998670bed1e9e567.zip
git-35d771591f673e1c2c7bc90b998670bed1e9e567.tar.gz
git-35d771591f673e1c2c7bc90b998670bed1e9e567.tar.bz2
Merge branch 'nd/init-relative-template-fix' into maint
A relative pathname given to "git init --template=<path> <repo>" ought to be relative to the directory "git init" gets invoked in, but it instead was made relative to the repository, which has been corrected. * nd/init-relative-template-fix: init: make --template path relative to $CWD
Diffstat (limited to 'builtin')
-rw-r--r--builtin/init-db.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin/init-db.c b/builtin/init-db.c
index 6ca0028..944ec77 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -502,6 +502,9 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
if (real_git_dir && !is_absolute_path(real_git_dir))
real_git_dir = real_pathdup(real_git_dir, 1);
+ if (template_dir && *template_dir && !is_absolute_path(template_dir))
+ template_dir = absolute_pathdup(template_dir);
+
if (argc == 1) {
int mkdir_tried = 0;
retry: