Skip to content

Commit 7f7932a

Browse files
author
Junio C Hamano
committed
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 <[email protected]>
1 parent 21cd8d0 commit 7f7932a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

unpack-trees.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ static int deleted_entry(struct cache_entry *ce, struct cache_entry *old,
525525
return 1;
526526
}
527527

528-
static int keep_entry(struct cache_entry *ce)
528+
static int keep_entry(struct cache_entry *ce, struct unpack_trees_options *o)
529529
{
530530
add_cache_entry(ce, ADD_CACHE_OK_TO_ADD);
531531
return 1;
@@ -682,7 +682,7 @@ int threeway_merge(struct cache_entry **stages,
682682
if (!head_match || !remote_match) {
683683
for (i = 1; i < o->head_idx; i++) {
684684
if (stages[i]) {
685-
keep_entry(stages[i]);
685+
keep_entry(stages[i], o);
686686
count++;
687687
break;
688688
}
@@ -695,8 +695,8 @@ int threeway_merge(struct cache_entry **stages,
695695
show_stage_entry(stderr, "remote ", stages[remote_match]);
696696
}
697697
#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); }
700700
return count;
701701
}
702702

@@ -728,7 +728,7 @@ int twoway_merge(struct cache_entry **src,
728728
(oldtree && newtree &&
729729
!same(oldtree, newtree) && /* 18 and 19*/
730730
same(current, newtree))) {
731-
return keep_entry(current);
731+
return keep_entry(current, o);
732732
}
733733
else if (oldtree && !newtree && same(current, oldtree)) {
734734
/* 10 or 11 */
@@ -774,7 +774,7 @@ int bind_merge(struct cache_entry **src,
774774
if (a && old)
775775
die("Entry '%s' overlaps. Cannot bind.", a->name);
776776
if (!a)
777-
return keep_entry(old);
777+
return keep_entry(old, o);
778778
else
779779
return merged_entry(a, NULL, o);
780780
}
@@ -804,7 +804,7 @@ int oneway_merge(struct cache_entry **src,
804804
ce_match_stat(old, &st, 1))
805805
old->ce_flags |= htons(CE_UPDATE);
806806
}
807-
return keep_entry(old);
807+
return keep_entry(old, o);
808808
}
809809
return merged_entry(a, old, o);
810810
}

0 commit comments

Comments
 (0)