@@ -277,6 +277,17 @@ static int unpack_nondirectories(int n, unsigned long mask,
277
277
return 0 ;
278
278
}
279
279
280
+ static int unpack_failed (struct unpack_trees_options * o , const char * message )
281
+ {
282
+ discard_index (& o -> result );
283
+ if (!o -> gently ) {
284
+ if (message )
285
+ return error ("%s" , message );
286
+ return -1 ;
287
+ }
288
+ return -1 ;
289
+ }
290
+
280
291
static int unpack_callback (int n , unsigned long mask , unsigned long dirmask , struct name_entry * names , struct traverse_info * info )
281
292
{
282
293
struct cache_entry * src [MAX_UNPACK_TREES + 1 ] = { NULL , };
@@ -294,7 +305,7 @@ static int unpack_callback(int n, unsigned long mask, unsigned long dirmask, str
294
305
int cmp = compare_entry (ce , info , p );
295
306
if (cmp < 0 ) {
296
307
if (unpack_index_entry (ce , o ) < 0 )
297
- return -1 ;
308
+ return unpack_failed ( o , NULL ) ;
298
309
continue ;
299
310
}
300
311
if (!cmp ) {
@@ -352,17 +363,6 @@ static int unpack_callback(int n, unsigned long mask, unsigned long dirmask, str
352
363
return mask ;
353
364
}
354
365
355
- static int unpack_failed (struct unpack_trees_options * o , const char * message )
356
- {
357
- discard_index (& o -> result );
358
- if (!o -> gently ) {
359
- if (message )
360
- return error ("%s" , message );
361
- return -1 ;
362
- }
363
- return -1 ;
364
- }
365
-
366
366
/*
367
367
* N-way merge "len" trees. Returns 0 on success, -1 on failure to manipulate the
368
368
* resulting index, -2 on failure to reflect the changes to the work tree.
@@ -617,7 +617,7 @@ static int verify_absent(struct cache_entry *ce, const char *action,
617
617
* found "foo/." in the working tree.
618
618
* This is tricky -- if we have modified
619
619
* files that are in "foo/" we would lose
620
- * it .
620
+ * them .
621
621
*/
622
622
ret = verify_clean_subdirectory (ce , action , o );
623
623
if (ret < 0 )
0 commit comments