diff options
author | SZEDER Gábor <szeder.dev@gmail.com> | 2019-01-23 18:51:22 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-01-23 13:12:56 -0800 |
commit | 857ba928a4125251f2b4a728ff8021d2adcdbd91 (patch) | |
tree | 5739898480acb2d86a7f5c8d24d4401b86c50011 /pack-bitmap.h | |
parent | commit-graph: rename "large edges" to "extra edges" (diff) | |
download | tgif-857ba928a4125251f2b4a728ff8021d2adcdbd91.tar.xz |
commit-graph: don't call write_graph_chunk_extra_edges() unnecessarily
The optional 'Extra Edge List' chunk of the commit graph file stores
parent information for commits with more than two parents. Since the
chunk is optional, write_commit_graph() looks through all commits to
find those with more than two parents, and then writes the commit
graph file header accordingly, i.e. if there are no such commits, then
there won't be a 'Extra Edge List' chunk written, only the three
mandatory chunks.
However, when it later comes to writing actual chunk data,
write_commit_graph() unconditionally invokes
write_graph_chunk_extra_edges(), even when it was decided earlier that
that chunk won't be written. Strictly speaking there is no bug here,
because write_graph_chunk_extra_edges() won't write anything if it
doesn't find any commits with more than two parents, but then it
unnecessarily and in vain looks through all commits once again in
search for such commits.
Don't call write_graph_chunk_extra_edges() when that chunk won't be
written to spare an unnecessary iteration over all commits.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack-bitmap.h')
0 files changed, 0 insertions, 0 deletions