mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-29 17:05:49 +00:00
fix error when including a missing config file relative to the home directory
This commit is contained in:
parent
047fe29c4f
commit
301dc26a5a
@ -1254,8 +1254,16 @@ static int strip_comments(char *line, int in_quotes)
|
|||||||
static int included_path(git_buf *out, const char *dir, const char *path)
|
static int included_path(git_buf *out, const char *dir, const char *path)
|
||||||
{
|
{
|
||||||
/* From the user's home */
|
/* From the user's home */
|
||||||
if (path[0] == '~' && path[1] == '/')
|
int result;
|
||||||
return git_sysdir_find_global_file(out, &path[1]);
|
if (path[0] == '~' && path[1] == '/') {
|
||||||
|
result = git_sysdir_find_global_file(out, &path[1]);
|
||||||
|
if (result == GIT_ENOTFOUND) {
|
||||||
|
git_buf_sets(out, &path[1]);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
return git_path_join_unrooted(out, path, dir, NULL);
|
return git_path_join_unrooted(out, path, dir, NULL);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user