unpack_trees.c: pass unpack_trees_options structure to keep_entry() as well.
Other decision functions, deleted_entry() and merged_entry() take one as their parameter, and this function should. I'll be introducing a separate index to build the result in, and am planning to pass it as the part of the structure. Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
@ -525,7 +525,7 @@ static int deleted_entry(struct cache_entry *ce, struct cache_entry *old,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int keep_entry(struct cache_entry *ce)
|
static int keep_entry(struct cache_entry *ce, struct unpack_trees_options *o)
|
||||||
{
|
{
|
||||||
add_cache_entry(ce, ADD_CACHE_OK_TO_ADD);
|
add_cache_entry(ce, ADD_CACHE_OK_TO_ADD);
|
||||||
return 1;
|
return 1;
|
||||||
@ -682,7 +682,7 @@ int threeway_merge(struct cache_entry **stages,
|
|||||||
if (!head_match || !remote_match) {
|
if (!head_match || !remote_match) {
|
||||||
for (i = 1; i < o->head_idx; i++) {
|
for (i = 1; i < o->head_idx; i++) {
|
||||||
if (stages[i]) {
|
if (stages[i]) {
|
||||||
keep_entry(stages[i]);
|
keep_entry(stages[i], o);
|
||||||
count++;
|
count++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -695,8 +695,8 @@ int threeway_merge(struct cache_entry **stages,
|
|||||||
show_stage_entry(stderr, "remote ", stages[remote_match]);
|
show_stage_entry(stderr, "remote ", stages[remote_match]);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (head) { count += keep_entry(head); }
|
if (head) { count += keep_entry(head, o); }
|
||||||
if (remote) { count += keep_entry(remote); }
|
if (remote) { count += keep_entry(remote, o); }
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -728,7 +728,7 @@ int twoway_merge(struct cache_entry **src,
|
|||||||
(oldtree && newtree &&
|
(oldtree && newtree &&
|
||||||
!same(oldtree, newtree) && /* 18 and 19*/
|
!same(oldtree, newtree) && /* 18 and 19*/
|
||||||
same(current, newtree))) {
|
same(current, newtree))) {
|
||||||
return keep_entry(current);
|
return keep_entry(current, o);
|
||||||
}
|
}
|
||||||
else if (oldtree && !newtree && same(current, oldtree)) {
|
else if (oldtree && !newtree && same(current, oldtree)) {
|
||||||
/* 10 or 11 */
|
/* 10 or 11 */
|
||||||
@ -774,7 +774,7 @@ int bind_merge(struct cache_entry **src,
|
|||||||
if (a && old)
|
if (a && old)
|
||||||
die("Entry '%s' overlaps. Cannot bind.", a->name);
|
die("Entry '%s' overlaps. Cannot bind.", a->name);
|
||||||
if (!a)
|
if (!a)
|
||||||
return keep_entry(old);
|
return keep_entry(old, o);
|
||||||
else
|
else
|
||||||
return merged_entry(a, NULL, o);
|
return merged_entry(a, NULL, o);
|
||||||
}
|
}
|
||||||
@ -804,7 +804,7 @@ int oneway_merge(struct cache_entry **src,
|
|||||||
ce_match_stat(old, &st, 1))
|
ce_match_stat(old, &st, 1))
|
||||||
old->ce_flags |= htons(CE_UPDATE);
|
old->ce_flags |= htons(CE_UPDATE);
|
||||||
}
|
}
|
||||||
return keep_entry(old);
|
return keep_entry(old, o);
|
||||||
}
|
}
|
||||||
return merged_entry(a, old, o);
|
return merged_entry(a, old, o);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user