diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-01-27 18:01:48 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-02-01 13:46:52 -0800 |
commit | ec4d77aa508ac36f1f65ca8f228d4cbac42d694c (patch) | |
tree | 169fe8ed79a2a1e2eb01cbf308f10c44e72ba9ed /attr.h | |
parent | 4b0c6961678b3feddd8974e8ad6c49c62da9e5cd (diff) | |
download | git-ec4d77aa508ac36f1f65ca8f228d4cbac42d694c.tar.gz |
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.h')
-rw-r--r-- | attr.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -25,7 +25,7 @@ extern const char git_attr__false[]; * Unset one is returned as NULL. */ struct git_attr_check { - struct git_attr *attr; + const struct git_attr *attr; const char *value; }; @@ -34,7 +34,7 @@ struct git_attr_check { * return value is a pointer to a null-delimited string that is part * of the internal data structure; it should not be modified or freed. */ -char *git_attr_name(struct git_attr *); +extern const char *git_attr_name(const struct git_attr *); int git_check_attr(const char *path, int, struct git_attr_check *); |