summaryrefslogtreecommitdiff
path: root/src/fileops.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fileops.c')
-rw-r--r--src/fileops.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/fileops.c b/src/fileops.c
index 4dfc8a533..b7ae94b75 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -624,15 +624,25 @@ static int git_futils_guess_xdg_dirs(git_buf *out)
#endif
}
+static int git_futils_guess_template_dirs(git_buf *out)
+{
+#ifdef GIT_WIN32
+ return git_win32__find_system_dirs(out, L"share\\git-core\\templates");
+#else
+ return git_buf_sets(out, "/usr/share/git-core/templates");
+#endif
+}
+
typedef int (*git_futils_dirs_guess_cb)(git_buf *out);
static git_buf git_futils__dirs[GIT_FUTILS_DIR__MAX] =
- { GIT_BUF_INIT, GIT_BUF_INIT, GIT_BUF_INIT };
+ { GIT_BUF_INIT, GIT_BUF_INIT, GIT_BUF_INIT, GIT_BUF_INIT };
static git_futils_dirs_guess_cb git_futils__dir_guess[GIT_FUTILS_DIR__MAX] = {
git_futils_guess_system_dirs,
git_futils_guess_global_dirs,
git_futils_guess_xdg_dirs,
+ git_futils_guess_template_dirs,
};
int git_futils_dirs_global_init(void)