@matheusbsbs / matheus-bagliano / commits / 66985e6629
Fork 0

unpack-trees: do not muck with attributes when we are not checking out

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Apr 18, 2009 at 00:18 UTC 66985e6629c4325ec6b1508bf4bda907c2a538cb
1 file changed +4 -2
unpack-trees.c
+4 -2
@@ -87,7 +87,8 @@ static int check_updates(struct unpack_trees_options *o)
87 cnt = 0;
88 }
89
90 - git_attr_set_direction(GIT_ATTR_CHECKOUT, &o->result);
90 + if (o->update)
91 + git_attr_set_direction(GIT_ATTR_CHECKOUT, &o->result);
92 for (i = 0; i < index->cache_nr; i++) {
93 struct cache_entry *ce = index->cache[i];
94
@@ -112,7 +113,8 @@ static int check_updates(struct unpack_trees_options *o)
113 }
114 }
115 stop_progress(&progress);
115 - git_attr_set_direction(GIT_ATTR_CHECKIN, NULL);
116 + if (o->update)
117 + git_attr_set_direction(GIT_ATTR_CHECKIN, NULL);
118 return errs != 0;
119 }
120