Skip to content

Commit 2845ce7

Browse files
pyokagangitster
authored andcommitted
dir.c: replace home_config_paths() with xdg_config_home()
Since only the xdg excludes file path is required, simplify the code by replacing use of home_config_paths() with xdg_config_home(). Signed-off-by: Paul Tan <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2527bbc commit 2845ce7

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

dir.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,14 +1622,11 @@ int remove_dir_recursively(struct strbuf *path, int flag)
16221622
void setup_standard_excludes(struct dir_struct *dir)
16231623
{
16241624
const char *path;
1625-
char *xdg_path;
16261625

16271626
dir->exclude_per_dir = ".gitignore";
16281627
path = git_path("info/exclude");
1629-
if (!excludes_file) {
1630-
home_config_paths(NULL, &xdg_path, "ignore");
1631-
excludes_file = xdg_path;
1632-
}
1628+
if (!excludes_file)
1629+
excludes_file = xdg_config_home("ignore");
16331630
if (!access_or_warn(path, R_OK, 0))
16341631
add_excludes_from_file(dir, path);
16351632
if (excludes_file && !access_or_warn(excludes_file, R_OK, 0))

0 commit comments

Comments
 (0)