@@ -464,7 +464,7 @@ static int traverse_trees_recursive(int n, unsigned long dirmask,
464
464
newinfo .pathspec = info -> pathspec ;
465
465
newinfo .name = * p ;
466
466
newinfo .pathlen += tree_entry_len (p ) + 1 ;
467
- newinfo .conflicts |= df_conflicts ;
467
+ newinfo .df_conflicts |= df_conflicts ;
468
468
469
469
for (i = 0 ; i < n ; i ++ , dirmask >>= 1 ) {
470
470
const unsigned char * sha1 = NULL ;
@@ -565,17 +565,12 @@ static int unpack_nondirectories(int n, unsigned long mask,
565
565
{
566
566
int i ;
567
567
struct unpack_trees_options * o = info -> data ;
568
- unsigned long conflicts ;
568
+ unsigned long conflicts = info -> df_conflicts | dirmask ;
569
569
570
570
/* Do we have *only* directories? Nothing to do */
571
571
if (mask == dirmask && !src [0 ])
572
572
return 0 ;
573
573
574
- conflicts = info -> conflicts ;
575
- if (o -> merge )
576
- conflicts >>= 1 ;
577
- conflicts |= dirmask ;
578
-
579
574
/*
580
575
* Ok, we've filled in up to any potential index entry in src[0],
581
576
* now do the rest.
@@ -807,13 +802,6 @@ static int unpack_callback(int n, unsigned long mask, unsigned long dirmask, str
807
802
808
803
/* Now handle any directories.. */
809
804
if (dirmask ) {
810
- unsigned long conflicts = mask & ~dirmask ;
811
- if (o -> merge ) {
812
- conflicts <<= 1 ;
813
- if (src [0 ])
814
- conflicts |= 1 ;
815
- }
816
-
817
805
/* special case: "diff-index --cached" looking at a tree */
818
806
if (o -> diff_index_cached &&
819
807
n == 1 && dirmask == 1 && S_ISDIR (names -> mode )) {
@@ -832,7 +820,7 @@ static int unpack_callback(int n, unsigned long mask, unsigned long dirmask, str
832
820
}
833
821
}
834
822
835
- if (traverse_trees_recursive (n , dirmask , conflicts ,
823
+ if (traverse_trees_recursive (n , dirmask , mask & ~ dirmask ,
836
824
names , info ) < 0 )
837
825
return -1 ;
838
826
return mask ;
0 commit comments