git-commit-vandalism/builtin
Ævar Arnfjörð Bjarmason 0f156dbb04 object-file API: split up and simplify check_object_signature()
Split up the check_object_signature() function into that non-streaming
version (it accepts an already filled "buf"), and a new
stream_object_signature() which will retrieve the object from storage,
and hash it on-the-fly.

All of the callers of check_object_signature() were effectively
calling two different functions, if we go by cyclomatic
complexity. I.e. they'd either take the early "if (map)" branch and
return early, or not. This has been the case since the "if (map)"
condition was added in 090ea12671 (parse_object: avoid putting whole
blob in core, 2012-03-07).

We can then further simplify the resulting check_object_signature()
function since only one caller wanted to pass a non-NULL "buf" and a
non-NULL "real_oidp". That "read_loose_object()" codepath used by "git
fsck" can instead use hash_object_file() followed by oideq().

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-02-25 17:16:31 -08:00
..
add.c i18n: turn even more messages into "cannot be used together" ones 2022-01-05 13:31:00 -08:00
am.c Merge branch 'ja/i18n-similar-messages' 2022-01-10 11:52:56 -08:00
annotate.c
apply.c
archive.c
bisect--helper.c
blame.c Merge branch 'ld/sparse-diff-blame' 2021-12-21 15:03:17 -08:00
branch.c Merge branch 'js/branch-track-inherit' 2022-01-20 15:25:38 -08:00
bugreport.c
bundle.c
cat-file.c i18n: turn even more messages into "cannot be used together" ones 2022-01-05 13:31:00 -08:00
check-attr.c
check-ignore.c
check-mailmap.c
check-ref-format.c
checkout--worker.c pkt-line.[ch]: remove unused packet_read_line_buf() 2021-10-15 13:09:40 -07:00
checkout-index.c
checkout.c object-file API: have write_object_file() take "enum object_type" 2022-02-25 17:16:31 -08:00
clean.c clean: do not attempt to remove startup_info->original_cwd 2021-12-09 13:33:13 -08:00
clone.c Merge branch 'ps/lockfile-cleanup-fix' 2022-01-12 15:11:43 -08:00
column.c
commit-graph.c Merge branch 'ab/ignore-replace-while-working-on-commit-graph' 2021-11-01 13:48:08 -07:00
commit-tree.c
commit.c i18n: turn even more messages into "cannot be used together" ones 2022-01-05 13:31:00 -08:00
config.c
count-objects.c
credential-cache--daemon.c
credential-cache.c
credential-store.c
credential.c doc: fix git credential synopsis 2021-10-28 09:57:09 -07:00
describe.c i18n: turn even more messages into "cannot be used together" ones 2022-01-05 13:31:00 -08:00
diff-files.c
diff-index.c
diff-tree.c i18n: refactor "foo and bar are mutually exclusive" 2022-01-05 13:29:23 -08:00
diff.c diff: enable and test the sparse index 2021-12-06 09:55:06 -08:00
difftool.c i18n: turn "options are incompatible" into "cannot be used together" 2022-01-05 13:29:23 -08:00
env--helper.c
fast-export.c object-file API: split up and simplify check_object_signature() 2022-02-25 17:16:31 -08:00
fast-import.c object-file API: add a format_object_header() function 2022-02-25 17:16:31 -08:00
fetch-pack.c
fetch.c Merge branch 'ps/lockfile-cleanup-fix' 2022-01-12 15:11:43 -08:00
fmt-merge-msg.c merge: allow to pretend a merge is made into a different branch 2021-12-20 14:55:02 -08:00
for-each-ref.c for-each-ref: delay parsing of --sort=<atom> options 2021-10-20 14:33:07 -07:00
for-each-repo.c
fsck.c run-command API users: use strvec_pushl(), not argv construction 2021-11-25 22:15:07 -08:00
gc.c usage.c + gc: add and use a die_message_errno() 2021-12-07 13:25:16 -08:00
get-tar-commit-id.c
grep.c grep: fix a "path_list" memory leak 2021-10-23 10:45:25 -07:00
hash-object.c Merge branch 'jc/prefix-filename-allocates' into maint 2021-10-12 13:51:32 -07:00
help.c run-command API users: use strvec_pushl(), not argv construction 2021-11-25 22:15:07 -08:00
index-pack.c object-file API: split up and simplify check_object_signature() 2022-02-25 17:16:31 -08:00
init-db.c i18n: refactor "foo and bar are mutually exclusive" 2022-01-05 13:29:23 -08:00
interpret-trailers.c
log.c Merge branch 'ja/i18n-similar-messages' 2022-01-10 11:52:56 -08:00
ls-files.c Merge branch 'ja/i18n-similar-messages' 2022-01-10 11:52:56 -08:00
ls-remote.c for-each-ref: delay parsing of --sort=<atom> options 2021-10-20 14:33:07 -07:00
ls-tree.c
mailinfo.c
mailsplit.c
merge-base.c
merge-file.c xdiff: implement a zealous diff3, or "zdiff3" 2021-12-01 14:45:58 -08:00
merge-index.c
merge-ours.c
merge-recursive.c
merge-tree.c
merge.c Merge branch 'ja/i18n-similar-messages' 2022-01-10 11:52:56 -08:00
mktag.c object-file API: split up and simplify check_object_signature() 2022-02-25 17:16:31 -08:00
mktree.c object-file API: have write_object_file() take "enum object_type" 2022-02-25 17:16:31 -08:00
multi-pack-index.c builtin/multi-pack-index.c: don't leak concatenated options 2021-10-28 15:32:14 -07:00
mv.c
name-rev.c name-rev: prefer shorter names over following merges 2021-12-04 23:39:34 -08:00
notes.c object-file API: have write_object_file() take "enum object_type" 2022-02-25 17:16:31 -08:00
pack-objects.c i18n: turn "options are incompatible" into "cannot be used together" 2022-01-05 13:29:23 -08:00
pack-redundant.c
pack-refs.c
patch-id.c
prune-packed.c
prune.c Merge branch 'ns/tmp-objdir' 2022-01-03 16:24:15 -08:00
pull.c fetch/pull: use the sparse index 2021-12-22 11:42:39 -08:00
push.c i18n: turn "options are incompatible" into "cannot be used together" 2022-01-05 13:29:23 -08:00
range-diff.c
read-tree.c
rebase.c i18n: turn even more messages into "cannot be used together" ones 2022-01-05 13:31:00 -08:00
receive-pack.c object-file API: have write_object_file() take "enum object_type" 2022-02-25 17:16:31 -08:00
reflog.c reflog + refs-backend: move "verbose" out of the backend 2021-12-22 16:24:14 -08:00
remote-ext.c
remote-fd.c
remote.c Merge branch 'ab/designated-initializers-more' 2021-10-18 15:47:57 -07:00
repack.c Merge branch 'ja/i18n-similar-messages' 2022-01-10 11:52:56 -08:00
replace.c object-file API: have write_object_file() take "enum object_type" 2022-02-25 17:16:31 -08:00
rerere.c
reset.c i18n: turn even more messages into "cannot be used together" ones 2022-01-05 13:31:00 -08:00
rev-list.c i18n: turn even more messages into "cannot be used together" ones 2022-01-05 13:31:00 -08:00
rev-parse.c
revert.c
rm.c Merge branch 'ja/i18n-similar-messages' 2022-01-10 11:52:56 -08:00
send-pack.c Merge branch 'jk/http-push-status-fix' 2021-10-29 15:43:12 -07:00
shortlog.c
show-branch.c i18n: turn "options are incompatible" into "cannot be used together" 2022-01-05 13:29:23 -08:00
show-index.c
show-ref.c
sparse-checkout.c Merge branch 'ds/sparse-checkout-malformed-pattern-fix' 2022-01-10 11:52:49 -08:00
stash.c Merge branch 'en/keep-cwd' 2022-01-26 22:22:24 -08:00
stripspace.c
submodule--helper.c i18n: refactor "foo and bar are mutually exclusive" 2022-01-05 13:29:23 -08:00
symbolic-ref.c
tag.c object-file API: have write_object_file() take "enum object_type" 2022-02-25 17:16:31 -08:00
unpack-file.c
unpack-objects.c object-file API: have write_object_file() take "enum object_type" 2022-02-25 17:16:31 -08:00
update-index.c
update-ref.c
update-server-info.c
upload-archive.c upload-archive: use regular "struct child_process" pattern 2021-11-25 22:15:07 -08:00
upload-pack.c
var.c var: add GIT_DEFAULT_BRANCH variable 2021-11-03 13:25:36 -07:00
verify-commit.c
verify-pack.c
verify-tag.c
worktree.c i18n: factorize "--foo requires --bar" and the like 2022-01-05 13:31:00 -08:00
write-tree.c