diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-05-31 16:16:48 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-05-31 16:16:48 -0700 |
commit | 1136e2c6426f736fd4fde6d4cf901e8b192ab30b (patch) | |
tree | aeedfae91a978000c93ab98a518bb1a7b431ec54 /commit.c | |
parent | 6e4f981ffb88c8a9d3d6128314f4dd4f54ffb8a8 (diff) | |
parent | 2d938fc7bcf2c8ce314c44955db5a4dd2e9b6adb (diff) | |
download | git-1136e2c6426f736fd4fde6d4cf901e8b192ab30b.tar.gz |
Merge branch 'cc/bisect' (early part)
* 'cc/bisect' (early part):
bisect: check ancestors without forking a "git rev-list" process
commit: add function to unparse a commit and its parents
bisect: rework some rev related functions to make them more reusable
Diffstat (limited to 'commit.c')
-rw-r--r-- | commit.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -316,6 +316,26 @@ int parse_commit(struct commit *item) return ret; } +static void unparse_commit_list(struct commit_list *list) +{ + for (; list; list = list->next) + unparse_commit(list->item); +} + +void unparse_commit(struct commit *item) +{ + item->object.flags = 0; + item->object.used = 0; + if (item->object.parsed) { + item->object.parsed = 0; + if (item->parents) { + unparse_commit_list(item->parents); + free_commit_list(item->parents); + item->parents = NULL; + } + } +} + struct commit_list *commit_list_insert(struct commit *item, struct commit_list **list_p) { struct commit_list *new_list = xmalloc(sizeof(struct commit_list)); |