{"thread":{"id":"6303","subject":"[PATCH 2/6] merge_base(): move traversal into a separate function.","startedAt":"2007-01-09T10:41:27Z","lastAt":"2007-01-09T10:41:27Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":6},"messages":[{"id":"31229","messageId":"7vtzz0o52g.fsf@assigned-by-dhcp.cox.net","threadId":"6303","inReplyTo":null,"subject":"[PATCH 2/6] merge_base(): move traversal into a separate function.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-09T10:41:27Z","receivedAt":"2007-01-09T10:41:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n commit.c |   38 ++++++++++++++++++++++----------------\n 1 files changed, 22 insertions(+), 16 deletions(-)\n\ndiff --git a/commit.c b/commit.c\nindex aa14c5a..53f43e3 100644\n--- a/commit.c\n+++ b/commit.c\n@@ -1034,25 +1034,10 @@ static struct commit *interesting(struct commit_list *list)\n \treturn NULL;\n }\n \n-static struct commit_list *merge_bases(struct commit *one, struct commit *two)\n+static struct commit_list *base_traverse(struct commit_list *list)\n {\n-\tstruct commit_list *list = NULL;\n \tstruct commit_list *result = NULL;\n \n-\tif (one == two)\n-\t\t/* We do not mark this even with RESULT so we do not\n-\t\t * have to clean it up.\n-\t\t */\n-\t\treturn commit_list_insert(one, &result);\n-\n-\tparse_commit(one);\n-\tparse_commit(two);\n-\n-\tone->object.flags |= PARENT1;\n-\ttwo->object.flags |= PARENT2;\n-\tinsert_by_date(one, &list);\n-\tinsert_by_date(two, &list);\n-\n \twhile (interesting(list)) {\n \t\tstruct commit *commit;\n \t\tstruct commit_list *parents;\n@@ -1098,6 +1083,27 @@ static struct commit_list *merge_bases(struct commit *one, struct commit *two)\n \treturn result;\n }\n \n+static struct commit_list *merge_bases(struct commit *one, struct commit *two)\n+{\n+\tstruct commit_list *list = NULL;\n+\n+\tif (one == two)\n+\t\t/* We do not mark this even with RESULT so we do not\n+\t\t * have to clean it up.\n+\t\t */\n+\t\treturn commit_list_insert(one, &list);\n+\n+\tparse_commit(one);\n+\tparse_commit(two);\n+\n+\tone->object.flags |= PARENT1;\n+\ttwo->object.flags |= PARENT2;\n+\tinsert_by_date(one, &list);\n+\tinsert_by_date(two, &list);\n+\n+\treturn base_traverse(list);\n+}\n+\n struct commit_list *get_merge_bases(struct commit *one,\n \t\t\t\t    struct commit *two,\n                                     int cleanup)\n-- \n1.4.4.4.g564d\n"}]}