File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,19 @@ typedef enum {
76
76
GIT_BLAME_IGNORE_WHITESPACE = (1 <<6 )
77
77
} git_blame_flag_t ;
78
78
79
+ /**
80
+ * Blame progress callback.
81
+ *
82
+ * Called for each blame suspect.
83
+ *
84
+ * - 'suspect' is the id of the suspect commit.
85
+ *
86
+ * Returning a non-zero value will abort the blame.
87
+ */
88
+ typedef int (* git_blame_progress_cb )(
89
+ const git_oid * suspect ,
90
+ void * payload );
91
+
79
92
/**
80
93
* Blame options structure
81
94
*
@@ -120,6 +133,9 @@ typedef struct git_blame_options {
120
133
* The default is the last line of the file.
121
134
*/
122
135
size_t max_line ;
136
+
137
+ git_blame_progress_cb progress_cb ;
138
+ void * payload ;
123
139
} git_blame_options ;
124
140
125
141
#define GIT_BLAME_OPTIONS_VERSION 1
Original file line number Diff line number Diff line change @@ -653,6 +653,14 @@ int git_blame__like_git(git_blame *blame, uint32_t opt)
653
653
if (!suspect )
654
654
break ;
655
655
656
+ /* Report progress. */
657
+ if (blame -> options .progress_cb ) {
658
+ int error ;
659
+ const git_oid * id = git_commit_id (suspect -> commit );
660
+ if ((error = blame -> options .progress_cb (id , blame -> options .payload )))
661
+ return error ;
662
+ }
663
+
656
664
/* We'll use this suspect later in the loop, so hold on to it for now. */
657
665
origin_incref (suspect );
658
666
You can’t perform that action at this time.
0 commit comments