From: René Scharfe Date: Sat, 1 Oct 2011 15:56:08 +0000 (+0200) Subject: revision: add leak_pending flag X-Git-Tag: v1.7.8-rc0~80^2~4 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4a43d374fcbdea26b3596592a497a1c16f90b9e6;p=git.git revision: add leak_pending flag The new flag leak_pending in struct rev_info can be used to prevent prepare_revision_walk from freeing the list of pending objects. It will still forget about them, so it really is leaked. This behaviour may look weird at first, but it can be useful if the pointer to the list is saved before calling prepare_revision_walk. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- diff --git a/revision.c b/revision.c index 2e8aa3393..6d329b46d 100644 --- a/revision.c +++ b/revision.c @@ -1974,7 +1974,8 @@ int prepare_revision_walk(struct rev_info *revs) } e++; } - free(list); + if (!revs->leak_pending) + free(list); if (revs->no_walk) return 0; diff --git a/revision.h b/revision.h index 45412656d..366a9b49b 100644 --- a/revision.h +++ b/revision.h @@ -97,6 +97,7 @@ struct rev_info { date_mode_explicit:1, preserve_subject:1; unsigned int disable_stdin:1; + unsigned int leak_pending:1; enum date_mode date_mode;