9
9
#include "run-command.h"
10
10
#include "bisect.h"
11
11
12
- static unsigned char (* skipped_sha1 )[20 ];
13
- static int skipped_sha1_nr ;
14
- static int skipped_sha1_alloc ;
12
+ struct sha1_array {
13
+ unsigned char (* sha1 )[20 ];
14
+ int sha1_nr ;
15
+ int sha1_alloc ;
16
+ };
17
+
18
+ static struct sha1_array skipped_revs ;
15
19
16
20
static const char * * rev_argv ;
17
21
static int rev_argv_nr ;
@@ -420,9 +424,9 @@ static int register_ref(const char *refname, const unsigned char *sha1,
420
424
ALLOC_GROW (rev_argv , rev_argv_nr + 1 , rev_argv_alloc );
421
425
rev_argv [rev_argv_nr ++ ] = good ;
422
426
} else if (!prefixcmp (refname , "skip-" )) {
423
- ALLOC_GROW (skipped_sha1 , skipped_sha1_nr + 1 ,
424
- skipped_sha1_alloc );
425
- hashcpy (skipped_sha1 [ skipped_sha1_nr ++ ], sha1 );
427
+ ALLOC_GROW (skipped_revs . sha1 , skipped_revs . sha1_nr + 1 ,
428
+ skipped_revs . sha1_alloc );
429
+ hashcpy (skipped_revs . sha1 [ skipped_revs . sha1_nr ++ ], sha1 );
426
430
}
427
431
428
432
return 0 ;
@@ -466,7 +470,8 @@ static int skipcmp(const void *a, const void *b)
466
470
467
471
static void prepare_skipped (void )
468
472
{
469
- qsort (skipped_sha1 , skipped_sha1_nr , sizeof (* skipped_sha1 ), skipcmp );
473
+ qsort (skipped_revs .sha1 , skipped_revs .sha1_nr ,
474
+ sizeof (* skipped_revs .sha1 ), skipcmp );
470
475
}
471
476
472
477
static const unsigned char * skipped_sha1_access (size_t index , void * table )
@@ -477,7 +482,7 @@ static const unsigned char *skipped_sha1_access(size_t index, void *table)
477
482
478
483
static int lookup_skipped (unsigned char * sha1 )
479
484
{
480
- return sha1_pos (sha1 , skipped_sha1 , skipped_sha1_nr ,
485
+ return sha1_pos (sha1 , skipped_revs . sha1 , skipped_revs . sha1_nr ,
481
486
skipped_sha1_access );
482
487
}
483
488
@@ -489,7 +494,7 @@ struct commit_list *filter_skipped(struct commit_list *list,
489
494
490
495
* tried = NULL ;
491
496
492
- if (!skipped_sha1_nr )
497
+ if (!skipped_revs . sha1_nr )
493
498
return list ;
494
499
495
500
prepare_skipped ();
@@ -551,7 +556,7 @@ static void bisect_common(struct rev_info *revs, const char *prefix,
551
556
mark_edges_uninteresting (revs -> commits , revs , NULL );
552
557
553
558
revs -> commits = find_bisection (revs -> commits , reaches , all ,
554
- !!skipped_sha1_nr );
559
+ !!skipped_revs . sha1_nr );
555
560
}
556
561
557
562
static void exit_if_skipped_commits (struct commit_list * tried ,
0 commit comments