Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-10-30 01:09:55 +0300
committerJunio C Hamano <gitster@pobox.com>2023-10-30 01:09:55 +0300
commit26dd307cfaabe3d3f0b01aad64969e76a317811a (patch)
tree7f7f48e785ab297fe1718c5b954f7c6be71d9653 /config.c
parent8183b63ff6a9c7eec5555e51e127e712efb64704 (diff)
parent9f9c40cf34c29d4ad700d9869435d159056fa6fb (diff)
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.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/config.c b/config.c
index f9a1cca4e8..b330c7adb4 100644
--- a/config.c
+++ b/config.c
@@ -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);