Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
diff-tree: call free_commit_list() instead of duplicating its code
author
René Scharfe
<l.s.r@web.de>
Tue, 8 Jul 2014 16:21:05 +0000
(18:21 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 8 Jul 2014 18:01:50 +0000
(11:01 -0700)
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/diff-tree.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
6f92e5f
)
diff --git
a/builtin/diff-tree.c
b/builtin/diff-tree.c
index be6417d166abf428d379a70b9d67f894da4641d1..ce0e019e0caa358e1f5e39e5ed51bec3945197e0 100644
(file)
--- 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;
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 */
/* 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)) {
commit->parents = NULL;
pptr = &(commit->parents);
while (line[pos] && !get_sha1_hex(line + pos, sha1)) {