summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 468224e)
raw | patch | inline | side by side (parent: 468224e)
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Sat, 1 Oct 2011 15:56:08 +0000 (17:56 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 3 Oct 2011 18:04:34 +0000 (11:04 -0700) |
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>
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>
revision.c | patch | blob | history | |
revision.h | patch | blob | history |
diff --git a/revision.c b/revision.c
index 2e8aa3393a74faea41878914bd66636162d6d10c..6d329b46dc16828b78c975bc1619d8aa0fcc5b48 100644 (file)
--- a/revision.c
+++ b/revision.c
}
e++;
}
- free(list);
+ if (!revs->leak_pending)
+ free(list);
if (revs->no_walk)
return 0;
diff --git a/revision.h b/revision.h
index 45412656ddcbbf2904b8e1a86e32e456899a9718..366a9b49b0f43ee69fc43267a8f58fba19c7ae36 100644 (file)
--- a/revision.h
+++ b/revision.h
date_mode_explicit:1,
preserve_subject:1;
unsigned int disable_stdin:1;
+ unsigned int leak_pending:1;
enum date_mode date_mode;