@matheusbsbs / matheus-bagliano / commits / 7a8e3895f6
Fork 0

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 <gitster@pobox.com>

Christian Couder committed May 27, 2009 at 07:09 UTC 7a8e3895f68e9ae4e44e521c78fc98768c2a88ec
3 files changed +1 -23
bisect.c
+1 -1
@@ -771,7 +771,7 @@ static int check_ancestors(const char *prefix)
771 /* Clean up objects used, as they will be reused. */
772 for (i = 0; i < pending_copy.nr; i++) {
773 struct object *o = pending_copy.objects[i].item;
774 - unparse_commit((struct commit *)o);
774 + clear_commit_marks((struct commit *)o, ALL_REV_FLAGS);
775 }
776
777 return res;
commit.c
-20
@@ -316,26 +316,6 @@ int parse_commit(struct commit *item)
316 return ret;
317 }
318
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 -
319 struct commit_list *commit_list_insert(struct commit *item, struct commit_list **list_p)
320 {
321 struct commit_list *new_list = xmalloc(sizeof(struct commit_list));
commit.h
-2
@@ -40,8 +40,6 @@ int parse_commit_buffer(struct commit *item, void *buffer, unsigned long size);
40
41 int parse_commit(struct commit *item);
42
43 -void unparse_commit(struct commit *item);
44 -
43 struct commit_list * commit_list_insert(struct commit *item, struct commit_list **list_p);
44 unsigned commit_list_count(const struct commit_list *l);
45 struct commit_list * insert_by_date(struct commit *item, struct commit_list **list);