Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-07-07 12:07:34 +0300
committerJunio C Hamano <gitster@pobox.com>2017-07-09 20:00:48 +0300
commitf35650dff6a4500e317803165b13cc087f48ee85 (patch)
tree06834131d7a81eeb7f7dbb3271f12676be1c34c0 /builtin/log.c
parent822601e8303270aebed493b11e0988a75f2646b8 (diff)
log: do not free parents when walking reflog
When we're doing a reflog walk (instead of walking the actual parent pointers), we may see commits multiple times. For this reason, we hold on to the commit buffer for each commit rather than freeing it after we've showed the commit. We should do the same for the parent list. Right now this is just a minor optimization. But once we refactor how reflog walks are performed, keeping the parents will avoid confusing us the second time we see the commit. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/log.c')
-rw-r--r--builtin/log.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/log.c b/builtin/log.c
index cf303b2c06..630d6cff2f 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -377,9 +377,9 @@ static int cmd_log_walk(struct rev_info *rev)
* walking the reflogs.
*/
free_commit_buffer(commit);
+ free_commit_list(commit->parents);
+ commit->parents = NULL;
}
- free_commit_list(commit->parents);
- commit->parents = NULL;
if (saved_nrl < rev->diffopt.needed_rename_limit)
saved_nrl = rev->diffopt.needed_rename_limit;
if (rev->diffopt.degraded_cc_to_c)