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
This commit is contained in:
Junio C Hamano
2019-06-13 13:18:46 -07:00
3 changed files with 7 additions and 4 deletions

View File

@@ -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: