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>
Junio C Hamano committed
Apr 2, 2007 at 00:06 UTC
7f7932ab25f2ddd6080c8b1e8bfd698e523eb7d4
1 file changed
+7
-7
unpack-trees.c
+7
-7
@@ -525,7 +525,7 @@ static int deleted_entry(struct cache_entry *ce, struct cache_entry *old,
525
return 1;
526
}
527
528
-static int keep_entry(struct cache_entry *ce)
528
+static int keep_entry(struct cache_entry *ce, struct unpack_trees_options *o)
529
{
530
add_cache_entry(ce, ADD_CACHE_OK_TO_ADD);
531
return 1;
@@ -682,7 +682,7 @@ int threeway_merge(struct cache_entry **stages,
682
if (!head_match || !remote_match) {
683
for (i = 1; i < o->head_idx; i++) {
684
if (stages[i]) {
685
- keep_entry(stages[i]);
685
+ keep_entry(stages[i], o);
686
count++;
687
break;
688
}
@@ -695,8 +695,8 @@ int threeway_merge(struct cache_entry **stages,
695
show_stage_entry(stderr, "remote ", stages[remote_match]);
696
}
697
#endif
698
- if (head) { count += keep_entry(head); }
699
- if (remote) { count += keep_entry(remote); }
698
+ if (head) { count += keep_entry(head, o); }
699
+ if (remote) { count += keep_entry(remote, o); }
700
return count;
701
}
702
@@ -728,7 +728,7 @@ int twoway_merge(struct cache_entry **src,
728
(oldtree && newtree &&
729
!same(oldtree, newtree) && /* 18 and 19*/
730
same(current, newtree))) {
731
- return keep_entry(current);
731
+ return keep_entry(current, o);
732
}
733
else if (oldtree && !newtree && same(current, oldtree)) {
734
/* 10 or 11 */
@@ -774,7 +774,7 @@ int bind_merge(struct cache_entry **src,
774
if (a && old)
775
die("Entry '%s' overlaps. Cannot bind.", a->name);
776
if (!a)
777
- return keep_entry(old);
777
+ return keep_entry(old, o);
778
else
779
return merged_entry(a, NULL, o);
780
}
@@ -804,7 +804,7 @@ int oneway_merge(struct cache_entry **src,
804
ce_match_stat(old, &st, 1))
805
old->ce_flags |= htons(CE_UPDATE);
806
}
807
- return keep_entry(old);
807
+ return keep_entry(old, o);
808
}
809
return merged_entry(a, old, o);
810
}