diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-12-22 09:09:55 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-12-22 10:02:13 -0800 |
commit | 84563a624e1e417c452491f3b9fba8879e989af0 (patch) | |
tree | eed5c8c13c3f3effc5e19f5fd3e98a706911549a | |
parent | 853563d7344ee532aa56f8a9aabcfdfb5c4fe2c3 (diff) | |
download | git-84563a624e1e417c452491f3b9fba8879e989af0.tar.gz |
unpack-trees.c: cosmetic fix
Make the parts a bit more readable before touching them.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | unpack-trees.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/unpack-trees.c b/unpack-trees.c index d5a453079a..aa585be1b0 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -390,7 +390,7 @@ static void add_same_unmerged(struct cache_entry *ce, static int unpack_index_entry(struct cache_entry *ce, struct unpack_trees_options *o) { - struct cache_entry *src[5] = { NULL }; + struct cache_entry *src[MAX_UNPACK_TREES + 1] = { NULL, }; int ret; src[0] = ce; @@ -436,7 +436,10 @@ static int switch_cache_bottom(struct traverse_info *info) return ret; } -static int traverse_trees_recursive(int n, unsigned long dirmask, unsigned long df_conflicts, struct name_entry *names, struct traverse_info *info) +static int traverse_trees_recursive(int n, unsigned long dirmask, + unsigned long df_conflicts, + struct name_entry *names, + struct traverse_info *info) { int i, ret, bottom; struct tree_desc t[MAX_UNPACK_TREES]; @@ -908,7 +911,7 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options if (!o->skip_sparse_checkout) { int empty_worktree = 1; - for (i = 0;i < o->result.cache_nr;i++) { + for (i = 0; i < o->result.cache_nr; i++) { struct cache_entry *ce = o->result.cache[i]; if (apply_sparse_checkout(ce, o)) { @@ -920,6 +923,7 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options } if (o->result.cache_nr && empty_worktree) { + /* dubious---why should this fail??? */ ret = unpack_failed(o, "Sparse checkout leaves no entry on working directory"); goto done; } @@ -931,7 +935,7 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options *o->dst_index = o->result; done: - for (i = 0;i < el.nr;i++) + for (i = 0; i < el.nr; i++) free(el.excludes[i]); if (el.excludes) free(el.excludes); |