attr: tighten const correctness with git_attr and match_attr