diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-06-13 13:18:46 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-06-13 13:18:46 -0700 |
commit | cf3269fba816d9b216b8b0d6e95ca6a345158de5 (patch) | |
tree | 9ce7316f6013088bd62ac092f8a5da6bb6767df8 /builtin/init-db.c | |
parent | Merge branch 'ab/send-email-transferencoding-fix' (diff) | |
parent | init: make --template path relative to $CWD (diff) | |
download | tgif-cf3269fba816d9b216b8b0d6e95ca6a345158de5.tar.xz |
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/init-db.c')
-rw-r--r-- | builtin/init-db.c | 3 |
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: |