@@ -70,7 +70,6 @@ static int entcmp(const char *name1, int dir1, const char *name2, int dir2)
70
70
71
71
static int unpack_trees_rec (struct tree_entry_list * * posns , int len ,
72
72
const char * base , struct unpack_trees_options * o ,
73
- int * indpos ,
74
73
struct tree_entry_list * df_conflict_list )
75
74
{
76
75
int baselen = strlen (base );
@@ -100,7 +99,7 @@ static int unpack_trees_rec(struct tree_entry_list **posns, int len,
100
99
cache_name = NULL ;
101
100
102
101
/* Check the cache */
103
- if (o -> merge && * indpos < active_nr ) {
102
+ if (o -> merge && o -> pos < active_nr ) {
104
103
/* This is a bit tricky: */
105
104
/* If the index has a subdirectory (with
106
105
* contents) as the first name, it'll get a
@@ -118,7 +117,7 @@ static int unpack_trees_rec(struct tree_entry_list **posns, int len,
118
117
* file case.
119
118
*/
120
119
121
- cache_name = active_cache [* indpos ]-> name ;
120
+ cache_name = active_cache [o -> pos ]-> name ;
122
121
if (strlen (cache_name ) > baselen &&
123
122
!memcmp (cache_name , base , baselen )) {
124
123
cache_name += baselen ;
@@ -158,8 +157,8 @@ static int unpack_trees_rec(struct tree_entry_list **posns, int len,
158
157
159
158
if (cache_name && !strcmp (cache_name , first )) {
160
159
any_files = 1 ;
161
- src [0 ] = active_cache [* indpos ];
162
- remove_cache_entry_at (* indpos );
160
+ src [0 ] = active_cache [o -> pos ];
161
+ remove_cache_entry_at (o -> pos );
163
162
}
164
163
165
164
for (i = 0 ; i < len ; i ++ ) {
@@ -228,7 +227,7 @@ static int unpack_trees_rec(struct tree_entry_list **posns, int len,
228
227
#if DBRT_DEBUG > 1
229
228
printf ("Added %d entries\n" , ret );
230
229
#endif
231
- * indpos += ret ;
230
+ o -> pos += ret ;
232
231
} else {
233
232
for (i = 0 ; i < src_size ; i ++ ) {
234
233
if (src [i ]) {
@@ -244,7 +243,7 @@ static int unpack_trees_rec(struct tree_entry_list **posns, int len,
244
243
newbase [baselen + pathlen ] = '/' ;
245
244
newbase [baselen + pathlen + 1 ] = '\0' ;
246
245
if (unpack_trees_rec (subposns , len , newbase , o ,
247
- indpos , df_conflict_list )) {
246
+ df_conflict_list )) {
248
247
retval = -1 ;
249
248
goto leave_directory ;
250
249
}
@@ -375,7 +374,6 @@ static void check_updates(struct cache_entry **src, int nr,
375
374
376
375
int unpack_trees (struct object_list * trees , struct unpack_trees_options * o )
377
376
{
378
- int indpos = 0 ;
379
377
unsigned len = object_list_length (trees );
380
378
struct tree_entry_list * * posns ;
381
379
int i ;
@@ -404,7 +402,7 @@ int unpack_trees(struct object_list *trees, struct unpack_trees_options *o)
404
402
posn = posn -> next ;
405
403
}
406
404
if (unpack_trees_rec (posns , len , o -> prefix ? o -> prefix : "" ,
407
- o , & indpos , & df_conflict_list ))
405
+ o , & df_conflict_list ))
408
406
return -1 ;
409
407
}
410
408
0 commit comments