We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 358a60e commit 709b1b6Copy full SHA for 709b1b6
src/repository.c
@@ -2032,9 +2032,15 @@ static int repo_init_structure(
2032
git_str_dispose(&template_buf);
2033
git_config_free(cfg);
2034
2035
+ /* If tdir does not exist, then do not error out. This matches the
2036
+ * behaviour of git(1), which just prints a warning and continues.
2037
+ * TODO: issue warning when warning API is available.
2038
+ * `git` prints to stderr: 'warning: templates not found in /path/to/tdir'
2039
+ */
2040
if (error < 0) {
- if (!default_template)
2041
+ if (!default_template && error != GIT_ENOTFOUND) {
2042
return error;
2043
+ }
2044
2045
/* if template was default, ignore error and use internal */
2046
git_error_clear();
0 commit comments