summaryrefslogtreecommitdiff
path: root/Documentation/gitrepository-layout.txt
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2014-06-10 17:39:11 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-06-12 10:29:42 -0700
commit10322a0aaf84382d8901f9ab59e59c39f0c035bb (patch)
tree970192cbf707078dc581dd734242fd5db166fc77 /Documentation/gitrepository-layout.txt
parentcommit: push commit_index update into alloc_commit_node (diff)
downloadtgif-10322a0aaf84382d8901f9ab59e59c39f0c035bb.tar.xz
do not create "struct commit" with xcalloc
In both blame and merge-recursive, we sometimes create a "fake" commit struct for convenience (e.g., to represent the HEAD state as if we would commit it). By allocating ourselves rather than using alloc_commit_node, we do not properly set the "index" field of the commit. This can produce subtle bugs if we then use commit-slab on the resulting commit, as we will share the "0" index with another commit. We can fix this by using alloc_commit_node() to allocate. Note that we cannot free the result, as it is part of our commit allocator. However, both cases were already leaking the allocated commit anyway, so there's nothing to fix up. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/gitrepository-layout.txt')
0 files changed, 0 insertions, 0 deletions