diff options
author | Taylor Blau <me@ttaylorr.com> | 2020-04-13 22:04:25 -0600 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-04-15 09:20:30 -0700 |
commit | 6830c360777468434184f60023e2562348c9dacc (patch) | |
tree | 1cf8125fb2e1d96f34115fee5aebae075a7ab414 /t/t5402-post-merge-hook.sh | |
parent | oidset: introduce 'oidset_size' (diff) | |
download | tgif-6830c360777468434184f60023e2562348c9dacc.tar.xz |
commit-graph.h: replace 'commit_hex' with 'commits'
The 'write_commit_graph()' function takes in either a string list of
pack indices, or a string list of hexadecimal commit OIDs. These
correspond to the '--stdin-packs' and '--stdin-commits' mode(s) from
'git commit-graph write'.
Using a string_list of hexadecimal commit IDs is not the most efficient
use of memory, since we can instead use the 'struct oidset', which is
more well-suited for this case.
This has another benefit which will become apparent in the following
commit. This is that we are about to disambiguate the kinds of errors we
produce with '--stdin-commits' into "non-hex input" and "hex-input, but
referring to a non-commit object". By having 'write_commit_graph' take
in a 'struct oidset *' of commits, we place the burden on the caller (in
this case, the builtin) to handle the first case, and the commit-graph
machinery can handle the second case.
Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5402-post-merge-hook.sh')
0 files changed, 0 insertions, 0 deletions