summaryrefslogtreecommitdiff
path: root/unpack-trees.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-04-18 00:18:01 +0200
committerJunio C Hamano <gitster@pobox.com>2009-04-17 21:05:49 -0700
commit66985e6629c4325ec6b1508bf4bda907c2a538cb (patch)
tree662937faecbbc201abc5b510eee8863f5f76b82e /unpack-trees.c
parent4191e80a3e8ee0fa0b8f97f9fba81c3549813fd5 (diff)
downloadgit-66985e6629c4325ec6b1508bf4bda907c2a538cb.tar.gz
unpack-trees: do not muck with attributes when we are not checking out
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'unpack-trees.c')
-rw-r--r--unpack-trees.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index 6847c2d966..e4eb8fa3af 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -87,7 +87,8 @@ static int check_updates(struct unpack_trees_options *o)
cnt = 0;
}
- git_attr_set_direction(GIT_ATTR_CHECKOUT, &o->result);
+ if (o->update)
+ git_attr_set_direction(GIT_ATTR_CHECKOUT, &o->result);
for (i = 0; i < index->cache_nr; i++) {
struct cache_entry *ce = index->cache[i];
@@ -112,7 +113,8 @@ static int check_updates(struct unpack_trees_options *o)
}
}
stop_progress(&progress);
- git_attr_set_direction(GIT_ATTR_CHECKIN, NULL);
+ if (o->update)
+ git_attr_set_direction(GIT_ATTR_CHECKIN, NULL);
return errs != 0;
}