@@ -391,6 +391,9 @@ struct blame_scoreboard {
391
391
392
392
/* callbacks */
393
393
void (* on_sanity_fail )(struct blame_scoreboard * , int );
394
+ void (* found_guilty_entry )(struct blame_entry * , void * );
395
+
396
+ void * found_guilty_entry_data ;
394
397
};
395
398
396
399
static void sanity_check_refcnt (struct blame_scoreboard * );
@@ -1729,9 +1732,10 @@ static int emit_one_suspect_detail(struct blame_origin *suspect, int repeat)
1729
1732
* The blame_entry is found to be guilty for the range.
1730
1733
* Show it in incremental output.
1731
1734
*/
1732
- static void found_guilty_entry (struct blame_entry * ent ,
1733
- struct progress_info * pi )
1735
+ static void found_guilty_entry (struct blame_entry * ent , void * data )
1734
1736
{
1737
+ struct progress_info * pi = (struct progress_info * )data ;
1738
+
1735
1739
if (incremental ) {
1736
1740
struct blame_origin * suspect = ent -> suspect ;
1737
1741
@@ -1754,11 +1758,6 @@ static void assign_blame(struct blame_scoreboard *sb, int opt)
1754
1758
{
1755
1759
struct rev_info * revs = sb -> revs ;
1756
1760
struct commit * commit = prio_queue_get (& sb -> commits );
1757
- struct progress_info pi = { NULL , 0 };
1758
-
1759
- if (show_progress )
1760
- pi .progress = start_progress_delay (_ ("Blaming lines" ),
1761
- sb -> num_lines , 50 , 1 );
1762
1761
1763
1762
while (commit ) {
1764
1763
struct blame_entry * ent ;
@@ -1800,7 +1799,8 @@ static void assign_blame(struct blame_scoreboard *sb, int opt)
1800
1799
suspect -> guilty = 1 ;
1801
1800
for (;;) {
1802
1801
struct blame_entry * next = ent -> next ;
1803
- found_guilty_entry (ent , & pi );
1802
+ if (sb -> found_guilty_entry )
1803
+ sb -> found_guilty_entry (ent , sb -> found_guilty_entry_data );
1804
1804
if (next ) {
1805
1805
ent = next ;
1806
1806
continue ;
@@ -1816,8 +1816,6 @@ static void assign_blame(struct blame_scoreboard *sb, int opt)
1816
1816
if (sb -> debug ) /* sanity */
1817
1817
sanity_check_refcnt (sb );
1818
1818
}
1819
-
1820
- stop_progress (& pi .progress );
1821
1819
}
1822
1820
1823
1821
static const char * format_time (timestamp_t time , const char * tz_str ,
@@ -2550,6 +2548,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
2550
2548
char * final_commit_name = NULL ;
2551
2549
enum object_type type ;
2552
2550
struct commit * final_commit = NULL ;
2551
+ struct progress_info pi = { NULL , 0 };
2553
2552
2554
2553
struct string_list range_list = STRING_LIST_INIT_NODUP ;
2555
2554
int output_option = 0 , opt = 0 ;
@@ -2905,8 +2904,16 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
2905
2904
2906
2905
read_mailmap (& mailmap , NULL );
2907
2906
2907
+ sb .found_guilty_entry = & found_guilty_entry ;
2908
+ sb .found_guilty_entry_data = & pi ;
2909
+ if (show_progress )
2910
+ pi .progress = start_progress_delay (_ ("Blaming lines" ),
2911
+ sb .num_lines , 50 , 1 );
2912
+
2908
2913
assign_blame (& sb , opt );
2909
2914
2915
+ stop_progress (& pi .progress );
2916
+
2910
2917
if (!incremental )
2911
2918
setup_pager ();
2912
2919
0 commit comments