Skip to content

Commit 2d08ead

Browse files
committed
attr: use home directory for ~ includes
Users can specify an attribute file to be included in the home directory using `~/filename` syntax. Instead of looking in the global configuration location (which may be overridden), use the user's _actual_ home directory. This allows callers to change the global configuration location separately from the home directory.
1 parent 523d8b6 commit 2d08ead

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libgit2/attrcache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ static int attr_cache__lookup_path(
300300

301301
/* expand leading ~/ as needed */
302302
if (cfgval && cfgval[0] == '~' && cfgval[1] == '/') {
303-
if (! (error = git_sysdir_expand_global_file(&buf, &cfgval[2])))
303+
if (! (error = git_sysdir_expand_homedir_file(&buf, &cfgval[2])))
304304
*out = git_str_detach(&buf);
305305
} else if (cfgval) {
306306
*out = git__strdup(cfgval);

0 commit comments

Comments
 (0)