Skip to content

Commit

Permalink
attr.c: replace home_config_paths() with xdg_config_home()
Browse files Browse the repository at this point in the history
Since only the xdg attributes file path is required, simplify the code
by using xdg_config_home() instead of home_config_paths().

Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Paul Tan authored and Junio C Hamano committed May 6, 2015
1 parent ea19289 commit 2527bbc
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,6 @@ static int git_attr_system(void)
static void bootstrap_attr_stack(void)
{
struct attr_stack *elem;
char *xdg_attributes_file;

if (attr_stack)
return;
Expand All @@ -497,10 +496,8 @@ static void bootstrap_attr_stack(void)
}
}

if (!git_attributes_file) {
home_config_paths(NULL, &xdg_attributes_file, "attributes");
git_attributes_file = xdg_attributes_file;
}
if (!git_attributes_file)
git_attributes_file = xdg_config_home("attributes");
if (git_attributes_file) {
elem = read_attr_from_file(git_attributes_file, 1);
if (elem) {
Expand Down

0 comments on commit 2527bbc

Please sign in to comment.