File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -214,6 +214,14 @@ struct commit_graft *lookup_commit_graft(const unsigned char *sha1)
214
214
return commit_graft [pos ];
215
215
}
216
216
217
+ int for_each_commit_graft (each_commit_graft_fn fn , void * cb_data )
218
+ {
219
+ int i , ret ;
220
+ for (i = ret = 0 ; i < commit_graft_nr && !ret ; i ++ )
221
+ ret = fn (commit_graft [i ], cb_data );
222
+ return ret ;
223
+ }
224
+
217
225
int write_shallow_commits (struct strbuf * out , int use_pack_protocol )
218
226
{
219
227
int i , count = 0 ;
Original file line number Diff line number Diff line change @@ -142,6 +142,7 @@ struct commit_graft {
142
142
int nr_parent ; /* < 0 if shallow commit */
143
143
unsigned char parent [FLEX_ARRAY ][20 ]; /* more */
144
144
};
145
+ typedef int (* each_commit_graft_fn )(const struct commit_graft * , void * );
145
146
146
147
struct commit_graft * read_graft_line (char * buf , int len );
147
148
int register_commit_graft (struct commit_graft * , int );
@@ -154,6 +155,7 @@ extern struct commit_list *get_octopus_merge_bases(struct commit_list *in);
154
155
extern int register_shallow (const unsigned char * sha1 );
155
156
extern int unregister_shallow (const unsigned char * sha1 );
156
157
extern int write_shallow_commits (struct strbuf * out , int use_pack_protocol );
158
+ extern int for_each_commit_graft (each_commit_graft_fn , void * );
157
159
extern int is_repository_shallow (void );
158
160
extern struct commit_list * get_shallow_commits (struct object_array * heads ,
159
161
int depth , int shallow_flag , int not_shallow_flag );
You can’t perform that action at this time.
0 commit comments