summaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2011-10-01 17:56:08 +0200
committerJunio C Hamano <gitster@pobox.com>2011-10-03 11:04:34 -0700
commit4a43d374fcbdea26b3596592a497a1c16f90b9e6 (patch)
tree02309fa81949421e5b2e6a6045c6687f03b31fd8 /revision.c
parent468224e580aeb55bd85b37b86f32baada3d17f1e (diff)
downloadgit-4a43d374fcbdea26b3596592a497a1c16f90b9e6.tar.gz
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 <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/revision.c b/revision.c
index 2e8aa3393a..6d329b46dc 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;