Skip to content

Commit e65b5e9

Browse files
committed
config: expand paths with git_sysdir_expand...
1 parent ed812ee commit e65b5e9

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

src/config.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,9 +1339,6 @@ int git_config_parse_int32(int32_t *out, const char *value)
13391339

13401340
int git_config_parse_path(git_buf *out, const char *value)
13411341
{
1342-
int error = 0;
1343-
const git_buf *home;
1344-
13451342
assert(out && value);
13461343

13471344
git_buf_sanitize(out);
@@ -1352,16 +1349,7 @@ int git_config_parse_path(git_buf *out, const char *value)
13521349
return -1;
13531350
}
13541351

1355-
if ((error = git_sysdir_get(&home, GIT_SYSDIR_GLOBAL)) < 0)
1356-
return error;
1357-
1358-
git_buf_sets(out, home->ptr);
1359-
git_buf_puts(out, value + 1);
1360-
1361-
if (git_buf_oom(out))
1362-
return -1;
1363-
1364-
return 0;
1352+
return git_sysdir_expand_global_file(out, value[1] ? &value[2] : NULL);
13651353
}
13661354

13671355
return git_buf_sets(out, value);

0 commit comments

Comments
 (0)