summaryrefslogtreecommitdiff
path: root/path.c
diff options
context:
space:
mode:
authorPaul Tan <pyokagan@gmail.com>2015-05-06 16:01:04 +0800
committerJunio C Hamano <gitster@pobox.com>2015-05-06 11:33:53 -0700
commit846e5dfbab5d5a0a85252c1400dc0371e02e75a8 (patch)
treece3cfe17f08b0d24be70615e8a30f506a11b0690 /path.c
parent509adc335274d2656829b18e1e83ccabda059ae3 (diff)
downloadgit-846e5dfbab5d5a0a85252c1400dc0371e02e75a8.tar.gz
path.c: remove home_config_paths()pt/xdg-config-path
home_config_paths() combines distinct functionality already implemented by expand_user_path() and xdg_config_home(), and it also hard-codes the path ~/.gitconfig, which makes it unsuitable to use for other home config file paths. Since its use will just add unnecessary complexity to the code, remove it. Signed-off-by: Paul Tan <pyokagan@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'path.c')
-rw-r--r--path.c28
1 files changed, 0 insertions, 28 deletions
diff --git a/path.c b/path.c
index 4edc1eb868..2436301cca 100644
--- a/path.c
+++ b/path.c
@@ -130,34 +130,6 @@ char *git_path(const char *fmt, ...)
return ret;
}
-void home_config_paths(char **global, char **xdg, char *file)
-{
- char *xdg_home = getenv("XDG_CONFIG_HOME");
- char *home = getenv("HOME");
- char *to_free = NULL;
-
- if (!home) {
- if (global)
- *global = NULL;
- } else {
- if (!xdg_home) {
- to_free = mkpathdup("%s/.config", home);
- xdg_home = to_free;
- }
- if (global)
- *global = mkpathdup("%s/.gitconfig", home);
- }
-
- if (xdg) {
- if (!xdg_home)
- *xdg = NULL;
- else
- *xdg = mkpathdup("%s/git/%s", xdg_home, file);
- }
-
- free(to_free);
-}
-
char *git_path_submodule(const char *path, const char *fmt, ...)
{
char *pathname = get_pathname();