Commit 7e8934bb by Linquize

Can guess win32 git template dir

parent f84bc388
...@@ -624,15 +624,25 @@ static int git_futils_guess_xdg_dirs(git_buf *out) ...@@ -624,15 +624,25 @@ static int git_futils_guess_xdg_dirs(git_buf *out)
#endif #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); typedef int (*git_futils_dirs_guess_cb)(git_buf *out);
static git_buf git_futils__dirs[GIT_FUTILS_DIR__MAX] = 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] = { static git_futils_dirs_guess_cb git_futils__dir_guess[GIT_FUTILS_DIR__MAX] = {
git_futils_guess_system_dirs, git_futils_guess_system_dirs,
git_futils_guess_global_dirs, git_futils_guess_global_dirs,
git_futils_guess_xdg_dirs, git_futils_guess_xdg_dirs,
git_futils_guess_template_dirs,
}; };
int git_futils_dirs_global_init(void) int git_futils_dirs_global_init(void)
......
...@@ -310,7 +310,8 @@ typedef enum { ...@@ -310,7 +310,8 @@ typedef enum {
GIT_FUTILS_DIR_SYSTEM = 0, GIT_FUTILS_DIR_SYSTEM = 0,
GIT_FUTILS_DIR_GLOBAL = 1, GIT_FUTILS_DIR_GLOBAL = 1,
GIT_FUTILS_DIR_XDG = 2, GIT_FUTILS_DIR_XDG = 2,
GIT_FUTILS_DIR__MAX = 3, GIT_FUTILS_DIR_TEMPLATE = 3,
GIT_FUTILS_DIR__MAX = 4,
} git_futils_dir_t; } git_futils_dir_t;
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment