[WIP PATCH 22/22] A merge should not be printed anyway
Signed-off-by: Bo Yang <struggleyb.nku@gmail.com>
---
line.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/line.c b/line.c
index bc9fc76..5782003 100644
--- a/line.c
+++ b/line.c
@@ -1023,8 +1023,6 @@ static void assign_parents_range(struct rev_info *rev, struct commit *commit)
* be an evil merge.
*/
copy = diff_line_range_clone_deeply(r);
- /* Never print out any diff for a merge commit */
- commit->object.flags &= ~NEED_PRINT;
parents = commit->parents;
while (parents) {
struct commit *p = parents->item;
@@ -1059,6 +1057,8 @@ static void assign_parents_range(struct rev_info *rev, struct commit *commit)
commit->parents = parents;
parents = parents->next;
commit->parents->next = NULL;
+
+ /* free the non-use commit_list */
while (parents) {
struct commit_list *list = parents;
parents = parents->next;
@@ -1084,6 +1084,9 @@ static void assign_parents_range(struct rev_info *rev, struct commit *commit)
}
out:
+ /* Never print out any diff for a merge commit */
+ commit->object.flags &= ~NEED_PRINT;
+
parents = commit->parents;
while (parents) {
state = lookup_decoration(&parents_state, &parents->item->object);
--
1.7.0.2.273.gc2413.dirty