summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-06-13 20:18:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-06-13 20:18:46 (GMT)
commitcf3269fba816d9b216b8b0d6e95ca6a345158de5 (patch)
tree9ce7316f6013088bd62ac092f8a5da6bb6767df8 /builtin
parent86d2271f06382ceeb66e891eff87166d858270e1 (diff)
parente1df7fe43f4e2e607ed24668e2942d45df8d2743 (diff)
downloadgit-cf3269fba816d9b216b8b0d6e95ca6a345158de5.zip
git-cf3269fba816d9b216b8b0d6e95ca6a345158de5.tar.gz
git-cf3269fba816d9b216b8b0d6e95ca6a345158de5.tar.bz2
Merge branch 'nd/init-relative-template-fix'
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: