This is the twelfth in a series of patches to convert various parts of
the code to struct object_id.
The primary changes here are to the sha1_file code, find_unique_abbrev,
and lookup_replace_object. Due to the circular nature of converting the
latter, there are several places where we briefly insert temporaries to
allow a multi-patch conversion.
Also included is a constant for object header length allocation. This
isn't strictly related to the series, but it makes for a nice cleanup of
hard-coded constants, which is good for maintainability.
This series further decreases the number of hard-coded constants in the
code. After this series, there are only 172 instances of the constant
"20" in the code (for any purpose) and 98 instances of "40".
Changes from v1:
* Rebase onto master.
brian m. carlson (36):
bulk-checkin: convert index_bulk_checkin to struct object_id
builtin/write-tree: convert to struct object_id
cache-tree: convert write_*_as_tree to object_id
cache-tree: convert remnants to struct object_id
resolve-undo: convert struct resolve_undo_info to object_id
tree: convert read_tree_recursive to struct object_id
ref-filter: convert grab_objectname to struct object_id
strbuf: convert strbuf_add_unique_abbrev to use struct object_id
wt-status: convert struct wt_status_state to object_id
Convert find_unique_abbrev* to struct object_id
http-walker: convert struct object_request to use struct object_id
send-pack: convert remaining functions to struct object_id
replace_object: convert struct replace_object to object_id
builtin/mktag: convert to struct object_id
archive: convert write_archive_entry_fn_t to object_id
archive: convert sha1_file_to_archive to struct object_id
builtin/index-pack: convert struct ref_delta_entry to object_id
sha1_file: convert read_loose_object to use struct object_id
sha1_file: convert check_sha1_signature to struct object_id
streaming: convert open_istream to use struct object_id
builtin/mktree: convert to struct object_id
sha1_file: convert assert_sha1_type to object_id
sha1_file: convert retry_bad_packed_offset to struct object_id
packfile: convert unpack_entry to struct object_id
Convert remaining callers of sha1_object_info_extended to object_id
sha1_file: convert sha1_object_info* to object_id
builtin/fmt-merge-msg: convert remaining code to object_id
builtin/notes: convert static functions to object_id
tree-walk: convert get_tree_entry_follow_symlinks internals to
object_id
streaming: convert istream internals to struct object_id
tree-walk: convert tree entry functions to object_id
sha1_file: convert read_object_with_reference to object_id
sha1_file: convert read_sha1_file to struct object_id
Convert lookup_replace_object to struct object_id
sha1_file: introduce a constant for max header length
convert: convert to struct object_id
apply.c | 4 +-
archive-tar.c | 28 ++++----
archive-zip.c | 18 ++---
archive.c | 32 ++++-----
archive.h | 10 +--
bisect.c | 3 +-
blame.c | 18 +++--
builtin/am.c | 8 +--
builtin/blame.c | 2 +-
builtin/branch.c | 2 +-
builtin/cat-file.c | 30 +++++----
builtin/checkout.c | 12 ++--
builtin/commit-tree.c | 2 +-
builtin/describe.c | 4 +-
builtin/difftool.c | 2 +-
builtin/fast-export.c | 8 +--
builtin/fetch.c | 10 +--
builtin/fmt-merge-msg.c | 4 +-
builtin/fsck.c | 4 +-
builtin/grep.c | 6 +-
builtin/index-pack.c | 43 ++++++------
builtin/log.c | 8 +--
builtin/ls-files.c | 4 +-
builtin/ls-tree.c | 8 +--
builtin/merge-tree.c | 5 +-
builtin/merge.c | 8 +--
builtin/mktag.c | 20 +++---
builtin/mktree.c | 24 +++----
builtin/name-rev.c | 2 +-
builtin/notes.c | 14 ++--
builtin/pack-objects.c | 27 ++++----
builtin/prune.c | 2 +-
builtin/receive-pack.c | 8 +--
builtin/reflog.c | 2 +-
builtin/replace.c | 10 +--
builtin/reset.c | 2 +-
builtin/rev-list.c | 2 +-
builtin/rev-parse.c | 2 +-
builtin/rm.c | 2 +-
builtin/show-branch.c | 2 +-
builtin/show-ref.c | 4 +-
builtin/tag.c | 16 +++--
builtin/unpack-file.c | 2 +-
builtin/unpack-objects.c | 4 +-
builtin/update-index.c | 2 +-
builtin/verify-commit.c | 2 +-
builtin/worktree.c | 4 +-
builtin/write-tree.c | 6 +-
bulk-checkin.c | 18 ++---
bulk-checkin.h | 2 +-
bundle.c | 2 +-
cache-tree.c | 36 +++++-----
cache-tree.h | 4 +-
cache.h | 42 ++++++------
combine-diff.c | 6 +-
commit.c | 8 +--
config.c | 2 +-
convert.c | 12 ++--
convert.h | 2 +-
diff.c | 6 +-
dir.c | 2 +-
entry.c | 4 +-
fast-import.c | 31 ++++-----
fsck.c | 2 +-
grep.c | 2 +-
http-push.c | 2 +-
http-walker.c | 16 ++---
line-log.c | 3 +-
list-objects-filter.c | 2 +-
log-tree.c | 12 ++--
mailmap.c | 2 +-
match-trees.c | 10 +--
merge-blobs.c | 4 +-
merge-recursive.c | 20 +++---
notes-cache.c | 2 +-
notes-merge.c | 2 +-
notes.c | 10 +--
object.c | 12 ++--
pack-bitmap-write.c | 3 +-
pack-check.c | 4 +-
packfile.c | 30 ++++-----
pretty.c | 8 +--
reachable.c | 2 +-
read-cache.c | 4 +-
ref-filter.c | 14 ++--
refs.c | 2 +-
remote-testsvn.c | 4 +-
remote.c | 2 +-
replace_object.c | 26 ++++----
rerere.c | 4 +-
resolve-undo.c | 8 +--
resolve-undo.h | 2 +-
send-pack.c | 12 ++--
sequencer.c | 9 +--
sha1_file.c | 137 ++++++++++++++++++++-------------------
sha1_name.c | 31 +++++----
strbuf.c | 4 +-
strbuf.h | 8 ++-
streaming.c | 18 ++---
streaming.h | 2 +-
submodule-config.c | 2 +-
submodule.c | 6 +-
tag.c | 10 +--
transport.c | 6 +-
tree-walk.c | 45 +++++++------
tree-walk.h | 2 +-
tree.c | 16 ++---
tree.h | 2 +-
wt-status.c | 20 +++---
wt-status.h | 6 +-
xdiff-interface.c | 2 +-
111 files changed, 591 insertions(+), 580 deletions(-)