diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-10-29 23:09:55 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-10-29 23:09:55 +0100 |
commit | 26dd307cfaabe3d3f0b01aad64969e76a317811a (patch) | |
tree | 7f7f48e785ab297fe1718c5b954f7c6be71d9653 /config.c | |
parent | Merge branch 'sn/typo-grammo-phraso-fixes' (diff) | |
parent | attr: add attr.tree for setting the treeish to read attributes from (diff) | |
download | git-26dd307cfaabe3d3f0b01aad64969e76a317811a.tar.xz git-26dd307cfaabe3d3f0b01aad64969e76a317811a.zip |
Merge branch 'jc/attr-tree-config'
The attribute subsystem learned to honor `attr.tree` configuration
that specifies which tree to read the .gitattributes files from.
* jc/attr-tree-config:
attr: add attr.tree for setting the treeish to read attributes from
attr: read attributes from HEAD when bare repo
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -19,6 +19,7 @@ #include "repository.h" #include "lockfile.h" #include "mailmap.h" +#include "attr.h" #include "exec-cmd.h" #include "strbuf.h" #include "quote.h" @@ -1760,6 +1761,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) { @@ -1783,6 +1796,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); |