summaryrefslogtreecommitdiff
path: root/attr.c
diff options
context:
space:
mode:
authorHenrik Grubbström <grubba@grubba.org>2010-04-06 14:46:43 +0200
committerJunio C Hamano <gitster@pobox.com>2010-04-10 18:36:00 -0700
commit969f9d73228f233aff071a0d07ba28afdb79dbc4 (patch)
treeade287b4e60d0f2e4b07beaa1a58422537c35542 /attr.c
parent426c27b7c0a415cec451d8fd369ecd5a86adf85e (diff)
downloadgit-969f9d73228f233aff071a0d07ba28afdb79dbc4.tar.gz
attr: Allow multiple changes to an attribute on the same line.
When using macros it isn't inconceivable to have an attribute being set by a macro, and then being reset explicitly. Signed-off-by: Henrik Grubbström <grubba@grubba.org> 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 7dc17b9505..53cf07e913 100644
--- a/attr.c
+++ b/attr.c
@@ -599,7 +599,7 @@ static int fill_one(const char *what, struct match_attr *a, int rem)
struct git_attr_check *check = check_all_attr;
int i;
- for (i = 0; 0 < rem && i < a->num_attr; i++) {
+ for (i = a->num_attr - 1; 0 < rem && 0 <= i; i--) {
struct git_attr *attr = a->state[i].attr;
const char **n = &(check[attr->attr_nr].value);
const char *v = a->state[i].setto;