summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2019-07-25 14:27:06 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-07-25 14:27:06 -0700
commit35d771591f673e1c2c7bc90b998670bed1e9e567 (patch)
tree33e4d257ec09ef3cebdb8dd94ce3251993b9b3a1 /builtin
parentGit 2.22 (diff)
parentinit: make --template path relative to $CWD (diff)
downloadtgif-35d771591f673e1c2c7bc90b998670bed1e9e567.tar.xz
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 6ca002893f..944ec77fe1 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: