aboutsummaryrefslogtreecommitdiff
path: root/attr.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-01-27 18:01:48 -0800
committerJunio C Hamano <gitster@pobox.com>2017-02-01 13:46:52 -0800
commitec4d77aa508ac36f1f65ca8f228d4cbac42d694c (patch)
tree169fe8ed79a2a1e2eb01cbf308f10c44e72ba9ed /attr.c
parent4b0c6961678b3feddd8974e8ad6c49c62da9e5cd (diff)
downloadgit-ec4d77aa508ac36f1f65ca8f228d4cbac42d694c.tar.gz
git-ec4d77aa508ac36f1f65ca8f228d4cbac42d694c.tar.xz
attr.c: tighten constness around "git_attr" structure
It holds an interned string, and git_attr_name() is a way to peek into it. Make sure the involved pointer types are pointer-to-const. Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'attr.c')
-rw-r--r--attr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/attr.c b/attr.c
index e42f931b3..f7cf7ae30 100644
--- a/attr.c
+++ b/attr.c
@@ -43,7 +43,7 @@ static int cannot_trust_maybe_real;
static struct git_attr_check *check_all_attr;
static struct git_attr *(git_attr_hash[HASHSIZE]);
-char *git_attr_name(struct git_attr *attr)
+const char *git_attr_name(const struct git_attr *attr)
{
return attr->name;
}