mirror of
https://github.com/git/git.git
synced 2026-03-13 10:23:30 +01:00
init: find template directory on Windows (msys)
The template directory must be searched for using the full Windows path. But internally a Unix path starting with '/' is used. The internal Unix path is now prefixed with git_install_prefix() before accessing the file system Only absolute Unix paths are converted. Relative paths can be used as is. Signed-off-by: Steffen Prohaska <prohaska@zib.de>
This commit is contained in:
@@ -145,6 +145,17 @@ static void copy_templates(const char *git_dir, int len, const char *template_di
|
||||
template_dir = prefix_path(exec_path, strlen(exec_path),
|
||||
template_dir);
|
||||
}
|
||||
#if __MINGW32__
|
||||
/*
|
||||
* If it is an absolute Unix path it is prefixed with
|
||||
* the git_install_prefix().
|
||||
*/
|
||||
else if (template_dir[0] == '/') {
|
||||
const char* prefix = git_install_prefix();
|
||||
template_dir = prefix_path(prefix, strlen(prefix),
|
||||
template_dir);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
strcpy(template_path, template_dir);
|
||||
template_len = strlen(template_path);
|
||||
|
||||
Reference in New Issue
Block a user