]> git.ipfire.org Git - thirdparty/git.git/blobdiff - config.c
attr: add attr.tree for setting the treeish to read attributes from
[thirdparty/git.git] / config.c
index 3846a37be971c92153eb1ceeb65c6e612c8e173c..fb6a2db1d9b6b65276e14bfaaf6972c34a3cda5e 100644 (file)
--- a/config.c
+++ b/config.c
@@ -18,6 +18,7 @@
 #include "repository.h"
 #include "lockfile.h"
 #include "mailmap.h"
+#include "attr.h"
 #include "exec-cmd.h"
 #include "strbuf.h"
 #include "quote.h"
@@ -1904,6 +1905,18 @@ static int git_default_mailmap_config(const char *var, const char *value)
        return 0;
 }
 
+static int git_default_attr_config(const char *var, const char *value)
+{
+       if (!strcmp(var, "attr.tree"))
+               return git_config_string(&git_attr_tree, var, value);
+
+       /*
+        * Add other attribute related config variables here and to
+        * Documentation/config/attr.txt.
+        */
+       return 0;
+}
+
 int git_default_config(const char *var, const char *value,
                       const struct config_context *ctx, void *cb)
 {
@@ -1927,6 +1940,9 @@ int git_default_config(const char *var, const char *value,
        if (starts_with(var, "mailmap."))
                return git_default_mailmap_config(var, value);
 
+       if (starts_with(var, "attr."))
+               return git_default_attr_config(var, value);
+
        if (starts_with(var, "advice.") || starts_with(var, "color.advice"))
                return git_default_advice_config(var, value);