diff options
author | Brandon Williams <bmwill@google.com> | 2017-01-27 18:02:04 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-02-01 13:46:53 -0800 |
commit | e810e0635767afbc9b304d5256fbdb26b59644fa (patch) | |
tree | 22565ccc823a22ec95e1bf937a7a8150bf52c79f /builtin/check-attr.c | |
parent | attr: remove maybe-real, maybe-macro from git_attr (diff) | |
download | tgif-e810e0635767afbc9b304d5256fbdb26b59644fa.tar.xz |
attr: tighten const correctness with git_attr and match_attr
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/check-attr.c')
-rw-r--r-- | builtin/check-attr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/check-attr.c b/builtin/check-attr.c index 40cdff13e9..4d01ca0c8b 100644 --- a/builtin/check-attr.c +++ b/builtin/check-attr.c @@ -166,7 +166,8 @@ int cmd_check_attr(int argc, const char **argv, const char *prefix) check = attr_check_alloc(); if (!all_attrs) { for (i = 0; i < cnt; i++) { - struct git_attr *a = git_attr(argv[i]); + const struct git_attr *a = git_attr(argv[i]); + if (!a) return error("%s: not a valid attribute name", argv[i]); |