diff-tree: call free_commit_list() instead of duplicating its code
Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
6f92e5ff3c
commit
4602f1a434
|
@ -22,14 +22,10 @@ static int stdin_diff_commit(struct commit *commit, char *line, int len)
|
||||||
if (isspace(line[40]) && !get_sha1_hex(line+41, sha1)) {
|
if (isspace(line[40]) && !get_sha1_hex(line+41, sha1)) {
|
||||||
/* Graft the fake parents locally to the commit */
|
/* Graft the fake parents locally to the commit */
|
||||||
int pos = 41;
|
int pos = 41;
|
||||||
struct commit_list **pptr, *parents;
|
struct commit_list **pptr;
|
||||||
|
|
||||||
/* Free the real parent list */
|
/* Free the real parent list */
|
||||||
for (parents = commit->parents; parents; ) {
|
free_commit_list(commit->parents);
|
||||||
struct commit_list *tmp = parents->next;
|
|
||||||
free(parents);
|
|
||||||
parents = tmp;
|
|
||||||
}
|
|
||||||
commit->parents = NULL;
|
commit->parents = NULL;
|
||||||
pptr = &(commit->parents);
|
pptr = &(commit->parents);
|
||||||
while (line[pos] && !get_sha1_hex(line + pos, sha1)) {
|
while (line[pos] && !get_sha1_hex(line + pos, sha1)) {
|
||||||
|
|
Loading…
Reference in New Issue