aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2014-07-08 18:21:05 +0200
committerJunio C Hamano <gitster@pobox.com>2014-07-08 11:01:50 -0700
commit4602f1a4346c881289011810c5f76886ca0e2d0c (patch)
treeae2f11071e87a36f2b6218ec083226d18388efea /builtin
parent6f92e5ff3cdc813de8ef5327fd4bad492fb7d6c9 (diff)
downloadgit-4602f1a4346c881289011810c5f76886ca0e2d0c.tar.gz
git-4602f1a4346c881289011810c5f76886ca0e2d0c.tar.xz
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>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/diff-tree.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/builtin/diff-tree.c b/builtin/diff-tree.c
index be6417d16..ce0e019e0 100644
--- a/builtin/diff-tree.c
+++ b/builtin/diff-tree.c
@@ -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)) {
/* Graft the fake parents locally to the commit */
int pos = 41;
- struct commit_list **pptr, *parents;
+ struct commit_list **pptr;
/* Free the real parent list */
- for (parents = commit->parents; parents; ) {
- struct commit_list *tmp = parents->next;
- free(parents);
- parents = tmp;
- }
+ free_commit_list(commit->parents);
commit->parents = NULL;
pptr = &(commit->parents);
while (line[pos] && !get_sha1_hex(line + pos, sha1)) {