summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2017-03-23 12:11:31 +0000
committerEdward Thomson <ethomson@edwardthomson.com>2017-03-23 12:12:39 +0000
commite65b5e960d23113854712ded8fcabd143b14377b (patch)
tree7cbc145ee9ca49c309d0a1feac354aee61cc267a
parented812ee725dc73536e5a963655ccdd8be8dec028 (diff)
downloadlibgit2-ethomson/expand_tilde.tar.gz
config: expand paths with `git_sysdir_expand...`ethomson/expand_tilde
-rw-r--r--src/config.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/config.c b/src/config.c
index 0d73ad2cc..0893febfa 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1339,9 +1339,6 @@ fail_parse:
int git_config_parse_path(git_buf *out, const char *value)
{
- int error = 0;
- const git_buf *home;
-
assert(out && value);
git_buf_sanitize(out);
@@ -1352,16 +1349,7 @@ int git_config_parse_path(git_buf *out, const char *value)
return -1;
}
- if ((error = git_sysdir_get(&home, GIT_SYSDIR_GLOBAL)) < 0)
- return error;
-
- git_buf_sets(out, home->ptr);
- git_buf_puts(out, value + 1);
-
- if (git_buf_oom(out))
- return -1;
-
- return 0;
+ return git_sysdir_expand_global_file(out, value[1] ? &value[2] : NULL);
}
return git_buf_sets(out, value);