git-commit-vandalism/builtin
Ævar Arnfjörð Bjarmason 4a93b899c1 libs: use "struct repository *" argument, not "the_repository"
As can easily be seen from grepping in our sources, we had these uses
of "the_repository" in various library code in cases where the
function in question was already getting a "struct repository *"
argument. Let's use that argument instead.

Out of these changes only the changes to "cache-tree.c",
"commit-reach.c", "shallow.c" and "upload-pack.c" would have cleanly
applied before the migration away from the "repo_*()" wrapper macros
in the preceding commits.

The rest aren't new, as we'd previously implicitly refer to
"the_repository", but it's now more obvious that we were doing the
wrong thing all along, and should have used the parameter instead.

The change to change "get_index_format_default(the_repository)" in
"read-cache.c" to use the "r" variable instead should arguably have
been part of [1], or in the subsequent cleanup in [2]. Let's do it
here, as can be seen from the initial code in [3] it's not important
that we use "the_repository" there, but would prefer to always use the
current repository.

This change excludes the "the_repository" use in "upload-pack.c"'s
upload_pack_advertise(), as the in-flight [4] makes that change.

1. ee1f0c242e (read-cache: add index.skipHash config option,
   2023-01-06)
2. 6269f8eaad (treewide: always have a valid "index_state.repo"
   member, 2023-01-17)
3. 7211b9e753 (repo-settings: consolidate some config settings,
   2019-08-13)
4. <Y/hbUsGPVNAxTdmS@coredump.intra.peff.net>

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-03-28 07:36:46 -07:00
..
add.c add API: remove run_add_interactive() wrapper function 2023-02-06 15:03:34 -08:00
am.c cocci: apply the "commit.h" part of "the_repository.pending" 2023-03-28 07:36:45 -07:00
annotate.c
apply.c
archive.c
bisect.c cocci: apply the "revision.h" part of "the_repository.pending" 2023-03-28 07:36:46 -07:00
blame.c cocci: apply the "commit.h" part of "the_repository.pending" 2023-03-28 07:36:45 -07:00
branch.c post-cocci: adjust comments for recent repo_* migration 2023-03-28 07:36:46 -07:00
bugreport.c built-ins: use free() not UNLEAK() if trivial, rm dead code 2022-11-21 12:32:48 +09:00
bundle.c Merge branch 'ab/bundle-wo-args' 2023-01-05 15:07:22 +09:00
cat-file.c cocci: apply the "promisor-remote.h" part of "the_repository.pending" 2023-03-28 07:36:46 -07:00
check-attr.c attr: add flag --source to work with tree-ish 2023-01-14 08:49:55 -08:00
check-ignore.c cocci: apply "pending" index-compatibility to some "builtin/*.c" 2022-11-21 12:06:15 +09:00
check-mailmap.c
check-ref-format.c
checkout--worker.c
checkout-index.c cocci: apply "pending" index-compatibility to some "builtin/*.c" 2022-11-21 12:06:15 +09:00
checkout.c cocci: apply the "refs.h" part of "the_repository.pending" 2023-03-28 07:36:46 -07:00
clean.c Merge branch 'ab/various-leak-fixes' 2023-02-22 14:55:45 -08:00
clone.c cocci: apply the "object-store.h" part of "the_repository.pending" 2023-03-28 07:36:45 -07:00
column.c
commit-graph.c commit-graph: fix a parse_options_concat() leak 2023-02-06 15:34:38 -08:00
commit-tree.c cocci: apply the "cache.h" part of "the_repository.pending" 2023-03-28 07:36:36 -07:00
commit.c cocci: apply the "pretty.h" part of "the_repository.pending" 2023-03-28 07:36:45 -07:00
config.c built-ins: use free() not UNLEAK() if trivial, rm dead code 2022-11-21 12:32:48 +09:00
count-objects.c
credential-cache--daemon.c credential: new attribute password_expiry_utc 2023-02-22 15:18:58 -08:00
credential-cache.c
credential-store.c
credential.c
describe.c cocci: apply the "commit.h" part of "the_repository.pending" 2023-03-28 07:36:45 -07:00
diagnose.c
diff-files.c cocci: apply "pending" index-compatibility to some "builtin/*.c" 2022-11-21 12:06:15 +09:00
diff-index.c cocci: apply "pending" index-compatibility to some "builtin/*.c" 2022-11-21 12:06:15 +09:00
diff-tree.c cocci: apply "pending" index-compatibility to some "builtin/*.c" 2022-11-21 12:06:15 +09:00
diff.c cocci: apply the "commit.h" part of "the_repository.pending" 2023-03-28 07:36:45 -07:00
difftool.c cocci: apply the "object-store.h" part of "the_repository.pending" 2023-03-28 07:36:45 -07:00
fast-export.c cocci: apply the "refs.h" part of "the_repository.pending" 2023-03-28 07:36:46 -07:00
fast-import.c cocci: apply the "object-store.h" part of "the_repository.pending" 2023-03-28 07:36:45 -07:00
fetch-pack.c
fetch.c cocci: apply the "promisor-remote.h" part of "the_repository.pending" 2023-03-28 07:36:46 -07:00
fmt-merge-msg.c
for-each-ref.c
for-each-repo.c for-each-repo: interpolate repo path arguments 2022-11-14 22:39:25 -05:00
fsck.c cocci: apply the "cache.h" part of "the_repository.pending" 2023-03-28 07:36:36 -07:00
fsmonitor--daemon.c Merge branch 'sx/pthread-error-check-fix' 2022-12-19 11:46:17 +09:00
gc.c cocci: apply the "promisor-remote.h" part of "the_repository.pending" 2023-03-28 07:36:46 -07:00
get-tar-commit-id.c
grep.c cocci: apply the "object-store.h" part of "the_repository.pending" 2023-03-28 07:36:45 -07:00
hash-object.c Merge branch 'jk/hash-object-literally-fd-leak' 2023-01-27 08:51:41 -08:00
help.c
hook.c hook: support a --to-stdin=<path> option 2023-02-08 12:50:03 -08:00
index-pack.c cocci: apply the "promisor-remote.h" part of "the_repository.pending" 2023-03-28 07:36:46 -07:00
init-db.c
interpret-trailers.c
log.c cocci: apply the "refs.h" part of "the_repository.pending" 2023-03-28 07:36:46 -07:00
ls-files.c cocci: apply the "cache.h" part of "the_repository.pending" 2023-03-28 07:36:36 -07:00
ls-remote.c doc/ls-remote: clarify pattern format 2023-02-10 21:57:51 -08:00
ls-tree.c cocci: apply the "cache.h" part of "the_repository.pending" 2023-03-28 07:36:36 -07:00
mailinfo.c
mailsplit.c
merge-base.c cocci: apply the "commit-reach.h" part of "the_repository.pending" 2023-03-28 07:36:36 -07:00
merge-file.c
merge-index.c cocci: apply "pending" index-compatibility to some "builtin/*.c" 2022-11-21 12:06:15 +09:00
merge-ours.c cocci: apply "pending" index-compatibility to some "builtin/*.c" 2022-11-21 12:06:15 +09:00
merge-recursive.c cocci: apply the "cache.h" part of "the_repository.pending" 2023-03-28 07:36:36 -07:00
merge-tree.c cocci: apply the "object-store.h" part of "the_repository.pending" 2023-03-28 07:36:45 -07:00
merge.c cocci: apply the "refs.h" part of "the_repository.pending" 2023-03-28 07:36:46 -07:00
mktag.c cocci: apply the "object-store.h" part of "the_repository.pending" 2023-03-28 07:36:45 -07:00
mktree.c
multi-pack-index.c
mv.c cocci & cache.h: apply pending "index_cache_pos" rule 2023-02-10 11:37:27 -08:00
name-rev.c cocci: apply the "commit.h" part of "the_repository.pending" 2023-03-28 07:36:45 -07:00
notes.c cocci: apply the "pretty.h" part of "the_repository.pending" 2023-03-28 07:36:45 -07:00
pack-objects.c cocci: apply the "promisor-remote.h" part of "the_repository.pending" 2023-03-28 07:36:46 -07:00
pack-redundant.c
pack-refs.c
patch-id.c
prune-packed.c
prune.c cocci: apply the "cache.h" part of "the_repository.pending" 2023-03-28 07:36:36 -07:00
pull.c cocci: apply the "cache.h" part of "the_repository.pending" 2023-03-28 07:36:36 -07:00
push.c push: free_refs() the "local_refs" in set_refspecs() 2023-02-06 15:34:40 -08:00
range-diff.c cocci: apply the "cache.h" part of "the_repository.pending" 2023-03-28 07:36:36 -07:00
read-tree.c cocci: apply the "cache.h" part of "the_repository.pending" 2023-03-28 07:36:36 -07:00
rebase.c cocci: apply the "diff.h" part of "the_repository.pending" 2023-03-28 07:36:45 -07:00
receive-pack.c cocci: apply the "object-store.h" part of "the_repository.pending" 2023-03-28 07:36:45 -07:00
reflog.c
remote-ext.c convert trivial uses of strncmp() to skip_prefix() 2023-01-08 10:34:37 +09:00
remote-fd.c convert trivial uses of strncmp() to starts_with() 2023-01-08 10:34:35 +09:00
remote.c cocci: apply the "object-store.h" part of "the_repository.pending" 2023-03-28 07:36:45 -07:00
repack.c cocci: apply the "promisor-remote.h" part of "the_repository.pending" 2023-03-28 07:36:46 -07:00
replace.c libs: use "struct repository *" argument, not "the_repository" 2023-03-28 07:36:46 -07:00
rerere.c diff: mark unused parameters in callbacks 2022-12-13 22:16:23 +09:00
reset.c cocci: apply the "refs.h" part of "the_repository.pending" 2023-03-28 07:36:46 -07:00
rev-list.c cocci: apply the "cache.h" part of "the_repository.pending" 2023-03-28 07:36:36 -07:00
rev-parse.c cocci: apply the "refs.h" part of "the_repository.pending" 2023-03-28 07:36:46 -07:00
revert.c builtin/revert.c: move free-ing of "revs" to replay_opts_release() 2023-02-06 16:03:52 -08:00
rm.c cocci: apply the "cache.h" part of "the_repository.pending" 2023-03-28 07:36:36 -07:00
send-pack.c
shortlog.c post-cocci: adjust comments for recent repo_* migration 2023-03-28 07:36:46 -07:00
show-branch.c cocci: apply the "refs.h" part of "the_repository.pending" 2023-03-28 07:36:46 -07:00
show-index.c
show-ref.c cocci: apply the "object-store.h" part of "the_repository.pending" 2023-03-28 07:36:45 -07:00
sparse-checkout.c cocci: apply the "cache.h" part of "the_repository.pending" 2023-03-28 07:36:36 -07:00
stash.c cocci: apply the "revision.h" part of "the_repository.pending" 2023-03-28 07:36:46 -07:00
stripspace.c
submodule--helper.c cocci: apply the "revision.h" part of "the_repository.pending" 2023-03-28 07:36:46 -07:00
symbolic-ref.c
tag.c cocci: apply the "object-store.h" part of "the_repository.pending" 2023-03-28 07:36:45 -07:00
unpack-file.c cocci: apply the "object-store.h" part of "the_repository.pending" 2023-03-28 07:36:45 -07:00
unpack-objects.c cocci: apply the "object-store.h" part of "the_repository.pending" 2023-03-28 07:36:45 -07:00
update-index.c cocci & cache.h: apply pending "index_cache_pos" rule 2023-02-10 11:37:27 -08:00
update-ref.c cocci: apply the "cache.h" part of "the_repository.pending" 2023-03-28 07:36:36 -07:00
update-server-info.c
upload-archive.c
upload-pack.c
var.c var: add GIT_SEQUENCE_EDITOR variable 2022-12-18 11:48:26 +09:00
verify-commit.c cocci: apply the "cache.h" part of "the_repository.pending" 2023-03-28 07:36:36 -07:00
verify-pack.c
verify-tag.c cocci: apply the "cache.h" part of "the_repository.pending" 2023-03-28 07:36:36 -07:00
worktree.c cocci: apply the "cache.h" part of "the_repository.pending" 2023-03-28 07:36:36 -07:00
write-tree.c cocci & cache-tree.h: migrate "write_cache_as_tree" to "*_index_*" 2023-02-10 11:37:49 -08:00