Skip to content

Commit 7a8e389

Browse files
chriscoolgitster
authored andcommitted
bisect: drop unparse_commit() and use clear_commit_marks()
The goal of this patch series is to check if good revisions are ancestor of the bad revision without forking a process to launch "git rev-list $good ^$bad". This new version of this patch series does not use an "unparse_commit" function anymore, we use "clear_commit_marks" instead. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2d938fc commit 7a8e389

File tree

3 files changed

+1
-23
lines changed

3 files changed

+1
-23
lines changed

bisect.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ static int check_ancestors(const char *prefix)
771771
/* Clean up objects used, as they will be reused. */
772772
for (i = 0; i < pending_copy.nr; i++) {
773773
struct object *o = pending_copy.objects[i].item;
774-
unparse_commit((struct commit *)o);
774+
clear_commit_marks((struct commit *)o, ALL_REV_FLAGS);
775775
}
776776

777777
return res;

commit.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -316,26 +316,6 @@ int parse_commit(struct commit *item)
316316
return ret;
317317
}
318318

319-
static void unparse_commit_list(struct commit_list *list)
320-
{
321-
for (; list; list = list->next)
322-
unparse_commit(list->item);
323-
}
324-
325-
void unparse_commit(struct commit *item)
326-
{
327-
item->object.flags = 0;
328-
item->object.used = 0;
329-
if (item->object.parsed) {
330-
item->object.parsed = 0;
331-
if (item->parents) {
332-
unparse_commit_list(item->parents);
333-
free_commit_list(item->parents);
334-
item->parents = NULL;
335-
}
336-
}
337-
}
338-
339319
struct commit_list *commit_list_insert(struct commit *item, struct commit_list **list_p)
340320
{
341321
struct commit_list *new_list = xmalloc(sizeof(struct commit_list));

commit.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ int parse_commit_buffer(struct commit *item, void *buffer, unsigned long size);
4040

4141
int parse_commit(struct commit *item);
4242

43-
void unparse_commit(struct commit *item);
44-
4543
struct commit_list * commit_list_insert(struct commit *item, struct commit_list **list_p);
4644
unsigned commit_list_count(const struct commit_list *l);
4745
struct commit_list * insert_by_date(struct commit *item, struct commit_list **list);

0 commit comments

Comments
 (0)