attr.c: replace home_config_paths() with xdg_config_home()
authorPaul Tan <pyokagan@gmail.com>
Wed, 6 May 2015 08:00:59 +0000 (16:00 +0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 May 2015 18:32:46 +0000 (11:32 -0700)
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>
attr.c
diff --git a/attr.c b/attr.c
index cd5469770a6f7841ae327e6ba7141dd99d9cacc1..c82904b6f291b2285f72afc1fa38244a9fa7669b 100644 (file)
--- a/attr.c
+++ b/attr.c
@@ -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;
@@ -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) {