]> git.ipfire.org Git - thirdparty/git.git/commitdiff
builtin: add a repository parameter for builtin functions
authorJohn Cai <johncai86@gmail.com>
Fri, 13 Sep 2024 21:16:14 +0000 (21:16 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 13 Sep 2024 21:27:08 +0000 (14:27 -0700)
In order to reduce the usage of the global the_repository, add a
parameter to builtin functions that will get passed a repository
variable.

This commit uses UNUSED on most of the builtin functions, as subsequent
commits will modify the actual builtins to pass the repository parameter
down.

Signed-off-by: John Cai <johncai86@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
127 files changed:
builtin.h
builtin/add.c
builtin/am.c
builtin/annotate.c
builtin/apply.c
builtin/archive.c
builtin/bisect.c
builtin/blame.c
builtin/branch.c
builtin/bugreport.c
builtin/bundle.c
builtin/cat-file.c
builtin/check-attr.c
builtin/check-ignore.c
builtin/check-mailmap.c
builtin/check-ref-format.c
builtin/checkout--worker.c
builtin/checkout-index.c
builtin/checkout.c
builtin/clean.c
builtin/clone.c
builtin/column.c
builtin/commit-graph.c
builtin/commit-tree.c
builtin/commit.c
builtin/config.c
builtin/count-objects.c
builtin/credential-cache--daemon.c
builtin/credential-cache.c
builtin/credential-store.c
builtin/credential.c
builtin/describe.c
builtin/diagnose.c
builtin/diff-files.c
builtin/diff-index.c
builtin/diff-tree.c
builtin/diff.c
builtin/difftool.c
builtin/fast-export.c
builtin/fast-import.c
builtin/fetch-pack.c
builtin/fetch.c
builtin/fmt-merge-msg.c
builtin/for-each-ref.c
builtin/for-each-repo.c
builtin/fsck.c
builtin/fsmonitor--daemon.c
builtin/gc.c
builtin/get-tar-commit-id.c
builtin/grep.c
builtin/hash-object.c
builtin/help.c
builtin/hook.c
builtin/index-pack.c
builtin/init-db.c
builtin/interpret-trailers.c
builtin/log.c
builtin/ls-files.c
builtin/ls-remote.c
builtin/ls-tree.c
builtin/mailinfo.c
builtin/mailsplit.c
builtin/merge-base.c
builtin/merge-file.c
builtin/merge-index.c
builtin/merge-ours.c
builtin/merge-recursive.c
builtin/merge-tree.c
builtin/merge.c
builtin/mktag.c
builtin/mktree.c
builtin/multi-pack-index.c
builtin/mv.c
builtin/name-rev.c
builtin/notes.c
builtin/pack-objects.c
builtin/pack-redundant.c
builtin/pack-refs.c
builtin/patch-id.c
builtin/prune-packed.c
builtin/prune.c
builtin/pull.c
builtin/push.c
builtin/range-diff.c
builtin/read-tree.c
builtin/rebase.c
builtin/receive-pack.c
builtin/reflog.c
builtin/refs.c
builtin/remote-ext.c
builtin/remote-fd.c
builtin/remote.c
builtin/repack.c
builtin/replace.c
builtin/replay.c
builtin/rerere.c
builtin/reset.c
builtin/rev-list.c
builtin/rev-parse.c
builtin/revert.c
builtin/rm.c
builtin/send-pack.c
builtin/shortlog.c
builtin/show-branch.c
builtin/show-index.c
builtin/show-ref.c
builtin/sparse-checkout.c
builtin/stash.c
builtin/stripspace.c
builtin/submodule--helper.c
builtin/symbolic-ref.c
builtin/tag.c
builtin/unpack-file.c
builtin/unpack-objects.c
builtin/update-index.c
builtin/update-ref.c
builtin/update-server-info.c
builtin/upload-archive.c
builtin/upload-pack.c
builtin/var.c
builtin/verify-commit.c
builtin/verify-pack.c
builtin/verify-tag.c
builtin/worktree.c
builtin/write-tree.c
git.c
help.c

index 14fa0171607b176639efa01cf5f720b4a4f8ad09..fc6fc8ffed8f6d71256decef010dc10123bca4b8 100644 (file)
--- a/builtin.h
+++ b/builtin.h
@@ -10,6 +10,7 @@
 #define USE_THE_REPOSITORY_VARIABLE
 
 #include "git-compat-util.h"
+#include "repository.h"
 
 /*
  * builtin API
@@ -122,143 +123,143 @@ int is_builtin(const char *s);
                BUG("unexpected prefix in builtin: %s", (prefix)); \
 } while (0)
 
-int cmd_add(int argc, const char **argv, const char *prefix);
-int cmd_am(int argc, const char **argv, const char *prefix);
-int cmd_annotate(int argc, const char **argv, const char *prefix);
-int cmd_apply(int argc, const char **argv, const char *prefix);
-int cmd_archive(int argc, const char **argv, const char *prefix);
-int cmd_bisect(int argc, const char **argv, const char *prefix);
-int cmd_blame(int argc, const char **argv, const char *prefix);
-int cmd_branch(int argc, const char **argv, const char *prefix);
-int cmd_bugreport(int argc, const char **argv, const char *prefix);
-int cmd_bundle(int argc, const char **argv, const char *prefix);
-int cmd_cat_file(int argc, const char **argv, const char *prefix);
-int cmd_checkout(int argc, const char **argv, const char *prefix);
-int cmd_checkout__worker(int argc, const char **argv, const char *prefix);
-int cmd_checkout_index(int argc, const char **argv, const char *prefix);
-int cmd_check_attr(int argc, const char **argv, const char *prefix);
-int cmd_check_ignore(int argc, const char **argv, const char *prefix);
-int cmd_check_mailmap(int argc, const char **argv, const char *prefix);
-int cmd_check_ref_format(int argc, const char **argv, const char *prefix);
-int cmd_cherry(int argc, const char **argv, const char *prefix);
-int cmd_cherry_pick(int argc, const char **argv, const char *prefix);
-int cmd_clone(int argc, const char **argv, const char *prefix);
-int cmd_clean(int argc, const char **argv, const char *prefix);
-int cmd_column(int argc, const char **argv, const char *prefix);
-int cmd_commit(int argc, const char **argv, const char *prefix);
-int cmd_commit_graph(int argc, const char **argv, const char *prefix);
-int cmd_commit_tree(int argc, const char **argv, const char *prefix);
-int cmd_config(int argc, const char **argv, const char *prefix);
-int cmd_count_objects(int argc, const char **argv, const char *prefix);
-int cmd_credential(int argc, const char **argv, const char *prefix);
-int cmd_credential_cache(int argc, const char **argv, const char *prefix);
-int cmd_credential_cache_daemon(int argc, const char **argv, const char *prefix);
-int cmd_credential_store(int argc, const char **argv, const char *prefix);
-int cmd_describe(int argc, const char **argv, const char *prefix);
-int cmd_diagnose(int argc, const char **argv, const char *prefix);
-int cmd_diff_files(int argc, const char **argv, const char *prefix);
-int cmd_diff_index(int argc, const char **argv, const char *prefix);
-int cmd_diff(int argc, const char **argv, const char *prefix);
-int cmd_diff_tree(int argc, const char **argv, const char *prefix);
-int cmd_difftool(int argc, const char **argv, const char *prefix);
-int cmd_env__helper(int argc, const char **argv, const char *prefix);
-int cmd_fast_export(int argc, const char **argv, const char *prefix);
-int cmd_fast_import(int argc, const char **argv, const char *prefix);
-int cmd_fetch(int argc, const char **argv, const char *prefix);
-int cmd_fetch_pack(int argc, const char **argv, const char *prefix);
-int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix);
-int cmd_for_each_ref(int argc, const char **argv, const char *prefix);
-int cmd_for_each_repo(int argc, const char **argv, const char *prefix);
-int cmd_format_patch(int argc, const char **argv, const char *prefix);
-int cmd_fsck(int argc, const char **argv, const char *prefix);
-int cmd_fsmonitor__daemon(int argc, const char **argv, const char *prefix);
-int cmd_gc(int argc, const char **argv, const char *prefix);
-int cmd_get_tar_commit_id(int argc, const char **argv, const char *prefix);
-int cmd_grep(int argc, const char **argv, const char *prefix);
-int cmd_hash_object(int argc, const char **argv, const char *prefix);
-int cmd_help(int argc, const char **argv, const char *prefix);
-int cmd_hook(int argc, const char **argv, const char *prefix);
-int cmd_index_pack(int argc, const char **argv, const char *prefix);
-int cmd_init_db(int argc, const char **argv, const char *prefix);
-int cmd_interpret_trailers(int argc, const char **argv, const char *prefix);
-int cmd_log(int argc, const char **argv, const char *prefix);
-int cmd_log_reflog(int argc, const char **argv, const char *prefix);
-int cmd_ls_files(int argc, const char **argv, const char *prefix);
-int cmd_ls_tree(int argc, const char **argv, const char *prefix);
-int cmd_ls_remote(int argc, const char **argv, const char *prefix);
-int cmd_mailinfo(int argc, const char **argv, const char *prefix);
-int cmd_mailsplit(int argc, const char **argv, const char *prefix);
-int cmd_maintenance(int argc, const char **argv, const char *prefix);
-int cmd_merge(int argc, const char **argv, const char *prefix);
-int cmd_merge_base(int argc, const char **argv, const char *prefix);
-int cmd_merge_index(int argc, const char **argv, const char *prefix);
-int cmd_merge_ours(int argc, const char **argv, const char *prefix);
-int cmd_merge_file(int argc, const char **argv, const char *prefix);
-int cmd_merge_recursive(int argc, const char **argv, const char *prefix);
-int cmd_merge_tree(int argc, const char **argv, const char *prefix);
-int cmd_mktag(int argc, const char **argv, const char *prefix);
-int cmd_mktree(int argc, const char **argv, const char *prefix);
-int cmd_multi_pack_index(int argc, const char **argv, const char *prefix);
-int cmd_mv(int argc, const char **argv, const char *prefix);
-int cmd_name_rev(int argc, const char **argv, const char *prefix);
-int cmd_notes(int argc, const char **argv, const char *prefix);
-int cmd_pack_objects(int argc, const char **argv, const char *prefix);
-int cmd_pack_redundant(int argc, const char **argv, const char *prefix);
-int cmd_patch_id(int argc, const char **argv, const char *prefix);
-int cmd_prune(int argc, const char **argv, const char *prefix);
-int cmd_prune_packed(int argc, const char **argv, const char *prefix);
-int cmd_pull(int argc, const char **argv, const char *prefix);
-int cmd_push(int argc, const char **argv, const char *prefix);
-int cmd_range_diff(int argc, const char **argv, const char *prefix);
-int cmd_read_tree(int argc, const char **argv, const char *prefix);
-int cmd_rebase(int argc, const char **argv, const char *prefix);
-int cmd_rebase__interactive(int argc, const char **argv, const char *prefix);
-int cmd_receive_pack(int argc, const char **argv, const char *prefix);
-int cmd_reflog(int argc, const char **argv, const char *prefix);
-int cmd_refs(int argc, const char **argv, const char *prefix);
-int cmd_remote(int argc, const char **argv, const char *prefix);
-int cmd_remote_ext(int argc, const char **argv, const char *prefix);
-int cmd_remote_fd(int argc, const char **argv, const char *prefix);
-int cmd_repack(int argc, const char **argv, const char *prefix);
-int cmd_replay(int argc, const char **argv, const char *prefix);
-int cmd_rerere(int argc, const char **argv, const char *prefix);
-int cmd_reset(int argc, const char **argv, const char *prefix);
-int cmd_restore(int argc, const char **argv, const char *prefix);
-int cmd_rev_list(int argc, const char **argv, const char *prefix);
-int cmd_rev_parse(int argc, const char **argv, const char *prefix);
-int cmd_revert(int argc, const char **argv, const char *prefix);
-int cmd_rm(int argc, const char **argv, const char *prefix);
-int cmd_send_pack(int argc, const char **argv, const char *prefix);
-int cmd_shortlog(int argc, const char **argv, const char *prefix);
-int cmd_show(int argc, const char **argv, const char *prefix);
-int cmd_show_branch(int argc, const char **argv, const char *prefix);
-int cmd_show_index(int argc, const char **argv, const char *prefix);
-int cmd_sparse_checkout(int argc, const char **argv, const char *prefix);
-int cmd_status(int argc, const char **argv, const char *prefix);
-int cmd_stash(int argc, const char **argv, const char *prefix);
-int cmd_stripspace(int argc, const char **argv, const char *prefix);
-int cmd_submodule__helper(int argc, const char **argv, const char *prefix);
-int cmd_switch(int argc, const char **argv, const char *prefix);
-int cmd_symbolic_ref(int argc, const char **argv, const char *prefix);
-int cmd_tag(int argc, const char **argv, const char *prefix);
-int cmd_unpack_file(int argc, const char **argv, const char *prefix);
-int cmd_unpack_objects(int argc, const char **argv, const char *prefix);
-int cmd_update_index(int argc, const char **argv, const char *prefix);
-int cmd_update_ref(int argc, const char **argv, const char *prefix);
-int cmd_update_server_info(int argc, const char **argv, const char *prefix);
-int cmd_upload_archive(int argc, const char **argv, const char *prefix);
-int cmd_upload_archive_writer(int argc, const char **argv, const char *prefix);
-int cmd_upload_pack(int argc, const char **argv, const char *prefix);
-int cmd_var(int argc, const char **argv, const char *prefix);
-int cmd_verify_commit(int argc, const char **argv, const char *prefix);
-int cmd_verify_tag(int argc, const char **argv, const char *prefix);
-int cmd_version(int argc, const char **argv, const char *prefix);
-int cmd_whatchanged(int argc, const char **argv, const char *prefix);
-int cmd_worktree(int argc, const char **argv, const char *prefix);
-int cmd_write_tree(int argc, const char **argv, const char *prefix);
-int cmd_verify_pack(int argc, const char **argv, const char *prefix);
-int cmd_show_ref(int argc, const char **argv, const char *prefix);
-int cmd_pack_refs(int argc, const char **argv, const char *prefix);
-int cmd_replace(int argc, const char **argv, const char *prefix);
+int cmd_add(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_am(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_annotate(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_apply(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_archive(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_bisect(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_blame(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_branch(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_bugreport(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_bundle(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_cat_file(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_checkout(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_checkout__worker(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_checkout_index(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_check_attr(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_check_ignore(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_check_mailmap(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_check_ref_format(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_cherry(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_cherry_pick(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_clone(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_clean(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_column(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_commit(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_commit_graph(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_commit_tree(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_config(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_count_objects(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_credential(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_credential_cache(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_credential_cache_daemon(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_credential_store(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_describe(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_diagnose(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_diff_files(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_diff_index(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_diff(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_diff_tree(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_difftool(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_env__helper(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_fast_export(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_fast_import(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_fetch(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_fetch_pack(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_for_each_ref(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_for_each_repo(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_format_patch(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_fsck(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_fsmonitor__daemon(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_gc(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_get_tar_commit_id(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_grep(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_hash_object(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_help(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_hook(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_index_pack(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_init_db(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_interpret_trailers(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_log_reflog(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_log(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_ls_files(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_ls_tree(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_ls_remote(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_mailinfo(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_mailsplit(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_maintenance(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_merge(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_merge_base(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_merge_index(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_merge_ours(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_merge_file(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_merge_recursive(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_merge_tree(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_mktag(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_mktree(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_multi_pack_index(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_mv(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_name_rev(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_notes(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_pack_objects(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_pack_redundant(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_patch_id(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_prune(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_prune_packed(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_pull(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_push(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_range_diff(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_read_tree(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_rebase(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_rebase__interactive(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_receive_pack(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_reflog(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_refs(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_remote(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_remote_ext(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_remote_fd(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_repack(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_replay(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_rerere(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_reset(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_restore(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_rev_list(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_rev_parse(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_revert(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_rm(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_send_pack(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_shortlog(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_show(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_show_branch(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_show_index(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_sparse_checkout(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_status(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_stash(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_stripspace(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_submodule__helper(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_switch(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_symbolic_ref(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_tag(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_unpack_file(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_unpack_objects(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_update_index(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_update_ref(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_update_server_info(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_upload_archive(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_upload_archive_writer(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_upload_pack(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_var(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_verify_commit(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_verify_tag(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_version(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_whatchanged(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_worktree(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_write_tree(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_verify_pack(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_show_ref(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_pack_refs(int argc, const char **argv, const char *prefix, struct repository *repo);
+int cmd_replace(int argc, const char **argv, const char *prefix, struct repository *repo);
 
 #endif
index 40b61ef90d98ca0b5905b570612f3fab25c723b9..ba331519cac4ebb3372ccd912a5b2e215cf70b82 100644 (file)
@@ -167,7 +167,10 @@ int interactive_add(const char **argv, const char *prefix, int patch)
        return ret;
 }
 
-static int edit_patch(int argc, const char **argv, const char *prefix)
+static int edit_patch(int argc,
+                     const char **argv,
+                     const char *prefix,
+                     struct repository *repo UNUSED)
 {
        char *file = git_pathdup("ADD_EDIT.patch");
        struct child_process child = CHILD_PROCESS_INIT;
@@ -358,7 +361,10 @@ static int add_files(struct dir_struct *dir, int flags)
        return exit_status;
 }
 
-int cmd_add(int argc, const char **argv, const char *prefix)
+int cmd_add(int argc,
+           const char **argv,
+           const char *prefix,
+           struct repository *repo UNUSED)
 {
        int exit_status = 0;
        struct pathspec pathspec;
@@ -387,7 +393,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
        if (edit_interactive) {
                if (pathspec_from_file)
                        die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--edit");
-               return(edit_patch(argc, argv, prefix));
+               return(edit_patch(argc, argv, prefix, the_repository));
        }
        argc--;
        argv++;
index d8875ad40229c1e33078f26f7e794d86a00ee741..8c610eed3e66e6e62f18f01df183fd9b67e54d81 100644 (file)
@@ -2298,7 +2298,10 @@ static int parse_opt_show_current_patch(const struct option *opt, const char *ar
        return 0;
 }
 
-int cmd_am(int argc, const char **argv, const char *prefix)
+int cmd_am(int argc,
+          const char **argv,
+          const char *prefix,
+          struct repository *repo UNUSED)
 {
        struct am_state state;
        int binary = -1;
index 58ff977a2314e2878ee0c7d3bcd9874b71bfdeef..0abf89ef18641000ba737f3c6582be3225317808 100644 (file)
@@ -7,7 +7,10 @@
 #include "builtin.h"
 #include "strvec.h"
 
-int cmd_annotate(int argc, const char **argv, const char *prefix)
+int cmd_annotate(int argc,
+                const char **argv,
+                const char *prefix,
+                struct repository *repo UNUSED)
 {
        struct strvec args = STRVEC_INIT;
        int i;
@@ -18,5 +21,5 @@ int cmd_annotate(int argc, const char **argv, const char *prefix)
                strvec_push(&args, argv[i]);
        }
 
-       return cmd_blame(args.nr, args.v, prefix);
+       return cmd_blame(args.nr, args.v, prefix, the_repository);
 }
index d623c52f78fc6d1a7b8064b48b7f13eb5fd1b73a..ca0bb97df40963853246ad4171971317dacf56b4 100644 (file)
@@ -9,7 +9,10 @@ static const char * const apply_usage[] = {
        NULL
 };
 
-int cmd_apply(int argc, const char **argv, const char *prefix)
+int cmd_apply(int argc,
+             const char **argv,
+             const char *prefix,
+             struct repository *repo UNUSED)
 {
        int force_apply = 0;
        int options = 0;
index b50981504f3bcf012f0f3d612c0d6927400e4871..de59c3ae97a2ec35b36318271320ad709109396c 100644 (file)
@@ -76,7 +76,10 @@ static int run_remote_archiver(int argc, const char **argv,
                             PARSE_OPT_KEEP_UNKNOWN_OPT |       \
                             PARSE_OPT_NO_INTERNAL_HELP )
 
-int cmd_archive(int argc, const char **argv, const char *prefix)
+int cmd_archive(int argc,
+               const char **argv,
+               const char *prefix,
+               struct repository *repo UNUSED)
 {
        const char *exec = "git-upload-archive";
        char *output = NULL;
index 453a6cccd70bca8218d93207dd32b00d5e5026b9..b83056df9f4392dfa46737ce31ff98b08d54dd3b 100644 (file)
@@ -1411,7 +1411,10 @@ static int cmd_bisect__run(int argc, const char **argv, const char *prefix UNUSE
        return res;
 }
 
-int cmd_bisect(int argc, const char **argv, const char *prefix)
+int cmd_bisect(int argc,
+              const char **argv,
+              const char *prefix,
+              struct repository *repo UNUSED)
 {
        int res = 0;
        parse_opt_subcommand_fn *fn = NULL;
index 35e975fb132ba7406ba084769b487136e1e31fec..728a62402b5580b4199cd8bf6ba0012a79fef6ea 100644 (file)
@@ -864,7 +864,10 @@ static void build_ignorelist(struct blame_scoreboard *sb,
        }
 }
 
-int cmd_blame(int argc, const char **argv, const char *prefix)
+int cmd_blame(int argc,
+             const char **argv,
+             const char *prefix,
+             struct repository *repo UNUSED)
 {
        struct rev_info revs;
        char *path = NULL;
index 3f870741bfd88a8da565b7571256056a393d3b4e..7980d2e83d6c891b60eba5a629356725cac41011 100644 (file)
@@ -704,7 +704,10 @@ static int edit_branch_description(const char *branch_name)
        return 0;
 }
 
-int cmd_branch(int argc, const char **argv, const char *prefix)
+int cmd_branch(int argc,
+              const char **argv,
+              const char *prefix,
+              struct repository *repo UNUSED)
 {
        /* possible actions */
        int delete = 0, rename = 0, copy = 0, list = 0,
index bdfed3d8f188c089be10dbdb1fd6b6294114fac3..aeab40c4902049ad09b570044f7f03db0b3b4a5f 100644 (file)
@@ -98,7 +98,10 @@ static void get_header(struct strbuf *buf, const char *title)
        strbuf_addf(buf, "\n\n[%s]\n", title);
 }
 
-int cmd_bugreport(int argc, const char **argv, const char *prefix)
+int cmd_bugreport(int argc,
+                 const char **argv,
+                 const char *prefix,
+                 struct repository *repo UNUSED)
 {
        struct strbuf buffer = STRBUF_INIT;
        struct strbuf report_path = STRBUF_INIT;
index 86d0ed7049c6531d2c198b39813cbfc3cc28e058..97f7f530d0e081562767c29169b20f5605676cf0 100644 (file)
@@ -226,7 +226,10 @@ cleanup:
        return ret;
 }
 
-int cmd_bundle(int argc, const char **argv, const char *prefix)
+int cmd_bundle(int argc,
+              const char **argv,
+              const char *prefix,
+              struct repository *repo UNUSED)
 {
        parse_opt_subcommand_fn *fn = NULL;
        struct option options[] = {
index 18fe58d6b8b043e182b50f6204c8803e32729845..b244b5a1ab6b7c55e5ef5025093c88e75cda2535 100644 (file)
@@ -191,7 +191,7 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name,
                        const char *ls_args[3] = { NULL };
                        ls_args[0] =  "ls-tree";
                        ls_args[1] =  obj_name;
-                       ret = cmd_ls_tree(2, ls_args, NULL);
+                       ret = cmd_ls_tree(2, ls_args, NULL, the_repository);
                        goto cleanup;
                }
 
@@ -923,7 +923,10 @@ static int batch_option_callback(const struct option *opt,
        return 0;
 }
 
-int cmd_cat_file(int argc, const char **argv, const char *prefix)
+int cmd_cat_file(int argc,
+                const char **argv,
+                const char *prefix,
+                struct repository *repo UNUSED)
 {
        int opt = 0;
        int opt_cw = 0;
index 9376810710066494adbd30b50f7f7a2f6a24cbf0..ffd1067558d1157fec34197089a97ff5fbebe1c4 100644 (file)
@@ -107,7 +107,10 @@ static NORETURN void error_with_usage(const char *msg)
        usage_with_options(check_attr_usage, check_attr_options);
 }
 
-int cmd_check_attr(int argc, const char **argv, const char *prefix)
+int cmd_check_attr(int argc,
+                  const char **argv,
+                  const char *prefix,
+                  struct repository *repo UNUSED)
 {
        struct attr_check *check;
        struct object_id initialized_oid;
index 2bda6a1d46291676533765925720b66ce3463a6f..70565b9f8921608c172d2aebe781da32e4ec5d7a 100644 (file)
@@ -151,7 +151,10 @@ static int check_ignore_stdin_paths(struct dir_struct *dir, const char *prefix)
        return num_ignored;
 }
 
-int cmd_check_ignore(int argc, const char **argv, const char *prefix)
+int cmd_check_ignore(int argc,
+                    const char **argv,
+                    const char *prefix,
+                    struct repository *repo UNUSED)
 {
        int num_ignored;
        struct dir_struct dir = DIR_INIT;
index b8a05b8e07b523953dfe9e8d6e572346a27d7791..87cc036dd146b50f84bb240abe9d06056db86e59 100644 (file)
@@ -40,7 +40,10 @@ static void check_mailmap(struct string_list *mailmap, const char *contact)
        printf("<%.*s>\n", (int)maillen, mail);
 }
 
-int cmd_check_mailmap(int argc, const char **argv, const char *prefix)
+int cmd_check_mailmap(int argc,
+                     const char **argv,
+                     const char *prefix,
+                     struct repository *repo UNUSED)
 {
        int i;
        struct string_list mailmap = STRING_LIST_INIT_NODUP;
index 5eb6bdc3f691e8a71e07fc2be80ee94e3599f522..6874edb4f4102f23a0e543dbb14572c0751ad522 100644 (file)
@@ -51,7 +51,10 @@ static int check_ref_format_branch(const char *arg)
        return 0;
 }
 
-int cmd_check_ref_format(int argc, const char **argv, const char *prefix)
+int cmd_check_ref_format(int argc,
+                        const char **argv,
+                        const char *prefix,
+                        struct repository *repo UNUSED)
 {
        int i;
        int normalize = 0;
index 6b62b5375bd2bf0d998f74ba2c63c071a5e76e73..f53e10826906be16b6d65ff8bcf9f844a3185eb4 100644 (file)
@@ -113,7 +113,10 @@ static const char * const checkout_worker_usage[] = {
        NULL
 };
 
-int cmd_checkout__worker(int argc, const char **argv, const char *prefix)
+int cmd_checkout__worker(int argc,
+                        const char **argv,
+                        const char *prefix,
+                        struct repository *repo UNUSED)
 {
        struct checkout state = CHECKOUT_INIT;
        struct option checkout_worker_options[] = {
index 29e744d11be410cbcd3b5ffd533d2701a8cab6de..98247ff823657aa57c18531f23a4857ee423f228 100644 (file)
@@ -208,7 +208,10 @@ static int option_parse_stage(const struct option *opt,
        return 0;
 }
 
-int cmd_checkout_index(int argc, const char **argv, const char *prefix)
+int cmd_checkout_index(int argc,
+                      const char **argv,
+                      const char *prefix,
+                      struct repository *repo UNUSED)
 {
        int i;
        struct lock_file lock_file = LOCK_INIT;
index 4cfe6fab505d6dfd905243adb63380eef0782038..d3bc48684f9ab4b0f28f6f9e714a2f7751070f93 100644 (file)
@@ -1953,7 +1953,10 @@ static int checkout_main(int argc, const char **argv, const char *prefix,
        return ret;
 }
 
-int cmd_checkout(int argc, const char **argv, const char *prefix)
+int cmd_checkout(int argc,
+                const char **argv,
+                const char *prefix,
+                struct repository *repo UNUSED)
 {
        struct checkout_opts opts = CHECKOUT_OPTS_INIT;
        struct option *options;
@@ -2000,7 +2003,10 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
                             checkout_usage);
 }
 
-int cmd_switch(int argc, const char **argv, const char *prefix)
+int cmd_switch(int argc,
+              const char **argv,
+              const char *prefix,
+              struct repository *repo UNUSED)
 {
        struct checkout_opts opts = CHECKOUT_OPTS_INIT;
        struct option *options = NULL;
@@ -2036,7 +2042,10 @@ int cmd_switch(int argc, const char **argv, const char *prefix)
                             switch_branch_usage);
 }
 
-int cmd_restore(int argc, const char **argv, const char *prefix)
+int cmd_restore(int argc,
+               const char **argv,
+               const char *prefix,
+               struct repository *repo UNUSED)
 {
        struct checkout_opts opts = CHECKOUT_OPTS_INIT;
        struct option *options;
index ded5a91534c49403c9627b0c6f71fa7ced6cf4f1..b5887f877e081dbfaeec34d280ff4f9d5f635850 100644 (file)
@@ -915,7 +915,10 @@ static void correct_untracked_entries(struct dir_struct *dir)
        dir->nr = dst;
 }
 
-int cmd_clean(int argc, const char **argv, const char *prefix)
+int cmd_clean(int argc,
+             const char **argv,
+             const char *prefix,
+             struct repository *repo UNUSED)
 {
        int i, res;
        int dry_run = 0, remove_directories = 0, quiet = 0, ignored = 0;
index 269b6e18a4e2dce496ee171653e35f73bcc8bdab..1b82310ac5b8f65c188621500085ac35a3405344 100644 (file)
@@ -956,7 +956,10 @@ static int path_exists(const char *path)
        return !stat(path, &sb);
 }
 
-int cmd_clone(int argc, const char **argv, const char *prefix)
+int cmd_clone(int argc,
+             const char **argv,
+             const char *prefix,
+             struct repository *repository UNUSED)
 {
        int is_bundle = 0, is_local;
        int reject_shallow = 0;
index 10ff7e01668203ce1b9233a90056abb65bc75e73..93f84beeee72f3953f7d8e14c776d77a6641b1f7 100644 (file)
@@ -18,7 +18,10 @@ static int column_config(const char *var, const char *value,
        return git_column_config(var, value, cb, &colopts);
 }
 
-int cmd_column(int argc, const char **argv, const char *prefix)
+int cmd_column(int argc,
+              const char **argv,
+              const char *prefix,
+              struct repository *repo UNUSED)
 {
        struct string_list list = STRING_LIST_INIT_DUP;
        struct strbuf sb = STRBUF_INIT;
index 7102ee90a0094b12560108eebe38f2637f83e701..65ce98d4675a11ed5ad558bda42c6e3a66a32471 100644 (file)
@@ -331,7 +331,10 @@ cleanup:
        return result;
 }
 
-int cmd_commit_graph(int argc, const char **argv, const char *prefix)
+int cmd_commit_graph(int argc,
+                    const char **argv,
+                    const char *prefix,
+                    struct repository *repo UNUSED)
 {
        parse_opt_subcommand_fn *fn = NULL;
        struct option builtin_commit_graph_options[] = {
index 84bb4502229af0ef20365d329ae72865d4285f34..bd8bf3296ed663bf0ba4ba0dafe326fa1ae25c6b 100644 (file)
@@ -90,7 +90,10 @@ static int parse_file_arg_callback(const struct option *opt,
        return 0;
 }
 
-int cmd_commit_tree(int argc, const char **argv, const char *prefix)
+int cmd_commit_tree(int argc,
+                   const char **argv,
+                   const char *prefix,
+                   struct repository *repo UNUSED)
 {
        static struct strbuf buffer = STRBUF_INIT;
        struct commit_list *parents = NULL;
index b2033c488778ff79c990c23a95f28d10898e2874..768d76ac461ff40cde3f236c640786c5d89f4361 100644 (file)
@@ -1502,7 +1502,10 @@ static int git_status_config(const char *k, const char *v,
        return git_diff_ui_config(k, v, ctx, NULL);
 }
 
-int cmd_status(int argc, const char **argv, const char *prefix)
+int cmd_status(int argc,
+const char **argv,
+const char *prefix,
+struct repository *repo UNUSED)
 {
        static int no_renames = -1;
        static const char *rename_score_arg = (const char *)-1;
@@ -1641,7 +1644,10 @@ static int git_commit_config(const char *k, const char *v,
        return git_status_config(k, v, ctx, s);
 }
 
-int cmd_commit(int argc, const char **argv, const char *prefix)
+int cmd_commit(int argc,
+              const char **argv,
+              const char *prefix,
+              struct repository *repo UNUSED)
 {
        static struct wt_status s;
        static struct option builtin_commit_options[] = {
index e00d983596b8db413ab7eba457bbbaafb26c5f33..841a5d706f41c3e112ae7fe9a6ab85e581e2fb40 100644 (file)
@@ -1392,7 +1392,10 @@ out:
        return ret;
 }
 
-int cmd_config(int argc, const char **argv, const char *prefix)
+int cmd_config(int argc,
+              const char **argv,
+              const char *prefix,
+              struct repository *repo UNUSED)
 {
        parse_opt_subcommand_fn *subcommand = NULL;
        struct option subcommand_opts[] = {
index ec6098a149d0e82be59f113935b61dfe55b4fc6c..6b905da3c3de5811961f94e75a683b8d71d4db46 100644 (file)
@@ -95,7 +95,10 @@ static char const * const count_objects_usage[] = {
        NULL
 };
 
-int cmd_count_objects(int argc, const char **argv, const char *prefix)
+int cmd_count_objects(int argc,
+                     const char **argv,
+                     const char *prefix,
+                     struct repository *repo UNUSED)
 {
        int human_readable = 0;
        struct option opts[] = {
index 4952b225477227862945e5f987582a76abdaf07e..4caaf38b841518bb226ed909342e7747821ecef5 100644 (file)
@@ -287,7 +287,10 @@ static void init_socket_directory(const char *path)
        free(path_copy);
 }
 
-int cmd_credential_cache_daemon(int argc, const char **argv, const char *prefix)
+int cmd_credential_cache_daemon(int argc,
+                               const char **argv,
+                               const char *prefix,
+                               struct repository *repo UNUSED)
 {
        struct tempfile *socket_file;
        const char *socket_path;
@@ -330,7 +333,10 @@ int cmd_credential_cache_daemon(int argc, const char **argv, const char *prefix)
 
 #else
 
-int cmd_credential_cache_daemon(int argc, const char **argv, const char *prefix)
+int cmd_credential_cache_daemon(int argc,
+const char **argv,
+const char *prefix,
+struct repository *repo UNUSED)
 {
        const char * const usage[] = {
                "git credential-cache--daemon [--debug] <socket-path>",
index aaf2f8438b45bf3ec503f71d5d86a41f50a1d07f..5de8b9123bf07c848077838b68e24f4ba4541eff 100644 (file)
@@ -137,7 +137,10 @@ static void announce_capabilities(void)
        credential_announce_capabilities(&c, stdout);
 }
 
-int cmd_credential_cache(int argc, const char **argv, const char *prefix)
+int cmd_credential_cache(int argc,
+                        const char **argv,
+                        const char *prefix,
+                        struct repository *repo UNUSED)
 {
        const char *socket_path_arg = NULL;
        char *socket_path;
index 97968bfa1c2d81c857016dd53a06bb61e43614f5..128704078e90a38d30f91d2549cafd320ac5f35f 100644 (file)
@@ -170,7 +170,10 @@ static void lookup_credential(const struct string_list *fns, struct credential *
                        return; /* Found credential */
 }
 
-int cmd_credential_store(int argc, const char **argv, const char *prefix)
+int cmd_credential_store(int argc,
+                        const char **argv,
+                        const char *prefix,
+                        struct repository *repo UNUSED)
 {
        const char * const usage[] = {
                "git credential-store [<options>] <action>",
index b72e76dd9a610f866b45f635f45bbf5b1ac45744..796422c6fe7f7403f5d1cc7d79afb7d90d7ce677 100644 (file)
@@ -6,7 +6,10 @@
 static const char usage_msg[] =
        "git credential (fill|approve|reject)";
 
-int cmd_credential(int argc, const char **argv, const char *prefix UNUSED)
+int cmd_credential(int argc,
+                  const char **argv,
+                  const char *prefix UNUSED,
+                  struct repository *repo UNUSED)
 {
        const char *op;
        struct credential c = CREDENTIAL_INIT;
index b43093c099f07aaee038e563e12c252962503948..1c1c250fe0c0a73e606d036f46248e842de0674e 100644 (file)
@@ -571,7 +571,10 @@ static int option_parse_exact_match(const struct option *opt, const char *arg,
        return 0;
 }
 
-int cmd_describe(int argc, const char **argv, const char *prefix)
+int cmd_describe(int argc,
+                const char **argv,
+                const char *prefix,
+                struct repository *repo UNUSED )
 {
        int contains = 0;
        struct option options[] = {
@@ -650,7 +653,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
                        argv_copy[i] = args.v[i];
                argv_copy[args.nr] = NULL;
 
-               ret = cmd_name_rev(args.nr, argv_copy, prefix);
+               ret = cmd_name_rev(args.nr, argv_copy, prefix, the_repository);
 
                strvec_clear(&args);
                free(argv_copy);
index 4857a4395ba6dedf39f27e102ab0d04f077366c6..66a22d918e68a48a7c31ef3b75335f9a2bad7ab1 100644 (file)
@@ -11,7 +11,10 @@ static const char * const diagnose_usage[] = {
        NULL
 };
 
-int cmd_diagnose(int argc, const char **argv, const char *prefix)
+int cmd_diagnose(int argc,
+                const char **argv,
+                const char *prefix,
+                struct repository *repo UNUSED)
 {
        struct strbuf zip_path = STRBUF_INIT;
        time_t now = time(NULL);
index 018011f29ea26be24b567e9af380699dd7d893a3..7f4f9bcb3eb1f1f5cd5c1ab5c3e01b0540fa5645 100644 (file)
@@ -17,7 +17,10 @@ static const char diff_files_usage[] =
 "\n"
 COMMON_DIFF_OPTIONS_HELP;
 
-int cmd_diff_files(int argc, const char **argv, const char *prefix)
+int cmd_diff_files(int argc,
+                  const char **argv,
+                  const char *prefix,
+                  struct repository *repo UNUSED)
 {
        struct rev_info rev;
        int result;
index 685b60284fd9e79f231c6dd0ca84cb749d2948bd..8abec38592f911c6c09e7889a0115da56951eae9 100644 (file)
@@ -14,7 +14,10 @@ static const char diff_cache_usage[] =
 "\n"
 COMMON_DIFF_OPTIONS_HELP;
 
-int cmd_diff_index(int argc, const char **argv, const char *prefix)
+int cmd_diff_index(int argc,
+                  const char **argv,
+                  const char *prefix,
+                  struct repository *repo UNUSED)
 {
        struct rev_info rev;
        unsigned int option = 0;
index b8df1d4b79b98180bab771eae8458dabf61ce852..841448b023fc1c1d79e482125a971c6446e664cb 100644 (file)
@@ -108,7 +108,10 @@ static void diff_tree_tweak_rev(struct rev_info *rev)
        }
 }
 
-int cmd_diff_tree(int argc, const char **argv, const char *prefix)
+int cmd_diff_tree(int argc,
+                 const char **argv,
+                 const char *prefix,
+                 struct repository *repo UNUSED)
 {
        char line[1000];
        struct object *tree1, *tree2;
index 6eac445579b22ff00421b87105822d661616652b..499b7872dd4ece6c57a732d5fc26c2f89e6626e1 100644 (file)
@@ -393,7 +393,10 @@ static void symdiff_release(struct symdiff *sdiff)
        bitmap_free(sdiff->skip);
 }
 
-int cmd_diff(int argc, const char **argv, const char *prefix)
+int cmd_diff(int argc,
+            const char **argv,
+            const char *prefix,
+            struct repository *repo UNUSED)
 {
        int i;
        struct rev_info rev;
index dcc68e190c25b47738bb7b59bfc8648339e810cb..c8700d67f4d515a35b360c31f422bfa08b3bb086 100644 (file)
@@ -690,7 +690,10 @@ static int run_file_diff(int prompt, const char *prefix,
        return run_command(child);
 }
 
-int cmd_difftool(int argc, const char **argv, const char *prefix)
+int cmd_difftool(int argc,
+                const char **argv,
+                const char *prefix,
+                struct repository *repo UNUSED)
 {
        int use_gui_tool = -1, dir_diff = 0, prompt = -1, symlinks = 0,
            tool_help = 0, no_index = 0;
index f253b79322a4d8f3ecaf2b6fd695a10bdbcc5e7b..1bd5949dd2499b350897a5cde2a4e0403310b25e 100644 (file)
@@ -1180,7 +1180,10 @@ static int parse_opt_anonymize_map(const struct option *opt,
        return 0;
 }
 
-int cmd_fast_export(int argc, const char **argv, const char *prefix)
+int cmd_fast_export(int argc,
+                   const char **argv,
+                   const char *prefix,
+                   struct repository *repo UNUSED)
 {
        struct rev_info revs;
        struct commit *commit;
index 2214c105f176a1fd8cfe5f228c0ab716821c7317..4b9e341aa44e09e73abe67499567d26fb0c7ec0c 100644 (file)
@@ -3537,7 +3537,10 @@ static void parse_argv(void)
        build_mark_map(&sub_marks_from, &sub_marks_to);
 }
 
-int cmd_fast_import(int argc, const char **argv, const char *prefix)
+int cmd_fast_import(int argc,
+                   const char **argv,
+                   const char *prefix,
+                   struct repository *repo UNUSED)
 {
        unsigned int i;
 
index af329e8d5cf6519a5d583f746f6e9d1e71186c6e..fddd8a2c1cdd2741ceb9086ea3853f56254d764a 100644 (file)
@@ -43,7 +43,10 @@ static void add_sought_entry(struct ref ***sought, int *nr, int *alloc,
        (*sought)[*nr - 1] = ref;
 }
 
-int cmd_fetch_pack(int argc, const char **argv, const char *prefix UNUSED)
+int cmd_fetch_pack(int argc,
+                  const char **argv,
+                  const char *prefix UNUSED,
+                  struct repository *repo UNUSED)
 {
        int i, ret;
        struct ref *ref = NULL;
index c297569a473f133cf7ba8e23f112fd1b0de3fa92..46ecfc5bc6241ed70416a5e9e297743f1831585f 100644 (file)
@@ -2138,7 +2138,10 @@ static int fetch_one(struct remote *remote, int argc, const char **argv,
        return exit_code;
 }
 
-int cmd_fetch(int argc, const char **argv, const char *prefix)
+int cmd_fetch(int argc,
+             const char **argv,
+             const char *prefix,
+             struct repository *repo UNUSED)
 {
        struct fetch_config config = {
                .display_format = DISPLAY_FORMAT_FULL,
index 957786d1b3ae7ba9b9d51b0b403c42bb00aba064..1fba4cf559045cdf0915fd60f82b99b4b008fa59 100644 (file)
@@ -9,7 +9,10 @@ static const char * const fmt_merge_msg_usage[] = {
        NULL
 };
 
-int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix)
+int cmd_fmt_merge_msg(int argc,
+                     const char **argv,
+                     const char *prefix,
+                     struct repository *repo UNUSED)
 {
        char *inpath = NULL;
        const char *message = NULL;
index 5517a4a1c084eef8982e1cb95daa444a9eb60606..b118758713584ac3923285b50a21fc176570cc83 100644 (file)
@@ -16,7 +16,10 @@ static char const * const for_each_ref_usage[] = {
        NULL
 };
 
-int cmd_for_each_ref(int argc, const char **argv, const char *prefix)
+int cmd_for_each_ref(int argc,
+                    const char **argv,
+                    const char *prefix,
+                    struct repository *repo UNUSED)
 {
        struct ref_sorting *sorting;
        struct string_list sorting_options = STRING_LIST_INIT_DUP;
index c4fa41fda9f763629f39033df2fca3ae4bda514b..93d82b952e9f5d5c2c8d7577f6bf4e112450d569 100644 (file)
@@ -29,7 +29,10 @@ static int run_command_on_repo(const char *path, int argc, const char ** argv)
        return run_command(&child);
 }
 
-int cmd_for_each_repo(int argc, const char **argv, const char *prefix)
+int cmd_for_each_repo(int argc,
+                     const char **argv,
+                     const char *prefix,
+                     struct repository *repo UNUSED)
 {
        static const char *config_key = NULL;
        int keep_going = 0;
index 60f4e6fad977bbaae34a468876db0107703841c1..87068cee09d5a1ad90e1d36a6698644876daf040 100644 (file)
@@ -925,7 +925,10 @@ static struct option fsck_opts[] = {
        OPT_END(),
 };
 
-int cmd_fsck(int argc, const char **argv, const char *prefix)
+int cmd_fsck(int argc,
+            const char **argv,
+            const char *prefix,
+            struct repository *repo UNUSED)
 {
        int i;
        struct object_directory *odb;
index 1593713f4cb29fe8e608f4c3c7502fa5a624d1f9..73a4b8856610dfc66ea3c6c60eba9a8324a3b5dc 100644 (file)
@@ -1521,7 +1521,10 @@ static int try_to_start_background_daemon(void)
        }
 }
 
-int cmd_fsmonitor__daemon(int argc, const char **argv, const char *prefix)
+int cmd_fsmonitor__daemon(int argc,
+                         const char **argv,
+                         const char *prefix,
+                         struct repository *repo UNUSED)
 {
        const char *subcmd;
        enum fsmonitor_reason reason;
@@ -1584,7 +1587,7 @@ int cmd_fsmonitor__daemon(int argc, const char **argv, const char *prefix)
 }
 
 #else
-int cmd_fsmonitor__daemon(int argc, const char **argv, const char *prefix UNUSED)
+int cmd_fsmonitor__daemon(int argc, const char **argv, const char *prefix UNUSED, struct repository *repo UNUSED)
 {
        struct option options[] = {
                OPT_END()
index 427faf1cfe1bdb66ad251e2bc040f88bc06bc0ea..0727de1ae8ef22171a42d16d8ced625c754d1e50 100644 (file)
@@ -657,7 +657,10 @@ static void gc_before_repack(struct maintenance_run_opts *opts,
        }
 }
 
-int cmd_gc(int argc, const char **argv, const char *prefix)
+int cmd_gc(int argc,
+const char **argv,
+const char *prefix,
+struct repository *repo UNUSED)
 {
        int aggressive = 0;
        int quiet = 0;
@@ -2890,7 +2893,10 @@ static const char * const builtin_maintenance_usage[] = {
        NULL,
 };
 
-int cmd_maintenance(int argc, const char **argv, const char *prefix)
+int cmd_maintenance(int argc,
+                   const char **argv,
+                   const char *prefix,
+                   struct repository *repo UNUSED)
 {
        parse_opt_subcommand_fn *fn = NULL;
        struct option builtin_maintenance_options[] = {
index 7195a072edc3d68d5d754e210b0e7dae6a7009ee..6bec0d1854c03ecbda0c364a7ff8313b10ca3069 100644 (file)
@@ -12,7 +12,10 @@ static const char builtin_get_tar_commit_id_usage[] =
 #define RECORDSIZE     (512)
 #define HEADERSIZE (2 * RECORDSIZE)
 
-int cmd_get_tar_commit_id(int argc, const char **argv UNUSED, const char *prefix)
+int cmd_get_tar_commit_id(int argc,
+                         const char **argv UNUSED,
+                         const char *prefix,
+                         struct repository *repo UNUSED)
 {
        char buffer[HEADERSIZE];
        struct ustar_header *header = (struct ustar_header *)buffer;
index dfc3c3e8bd28a009cdf4a4f7b95ab63588140a7f..da11879c6378776225c6b3a6d4eaf8b55baee375 100644 (file)
@@ -888,7 +888,10 @@ static int pattern_callback(const struct option *opt, const char *arg,
        return 0;
 }
 
-int cmd_grep(int argc, const char **argv, const char *prefix)
+int cmd_grep(int argc,
+            const char **argv,
+            const char *prefix,
+            struct repository *repo UNUSED)
 {
        int hit = 0;
        int cached = 0, untracked = 0, opt_exclude = -1;
index c767414a0cc6ca995df001ecb9f621959f892bc6..090daea5cd8fdacad26f7c6b5156eecde4fc3199 100644 (file)
@@ -84,7 +84,10 @@ static void hash_stdin_paths(const char *type, int no_filters, unsigned flags,
        strbuf_release(&unquoted);
 }
 
-int cmd_hash_object(int argc, const char **argv, const char *prefix)
+int cmd_hash_object(int argc,
+                   const char **argv,
+                   const char *prefix,
+                   struct repository *repo UNUSED)
 {
        static const char * const hash_object_usage[] = {
                N_("git hash-object [-t <type>] [-w] [--path=<file> | --no-filters]\n"
index dc1fbe2b9862df507dc1e077258d3c44048eebef..f7723bdf5c866da66a39d895385fe28f2886409f 100644 (file)
@@ -631,7 +631,10 @@ static void opt_mode_usage(int argc, const char *opt_mode,
        no_help_format(opt_mode, fmt);
 }
 
-int cmd_help(int argc, const char **argv, const char *prefix)
+int cmd_help(int argc,
+            const char **argv,
+            const char *prefix,
+            struct repository *repo UNUSED)
 {
        int nongit;
        enum help_format parsed_help_format;
index cc37438fdee10e0375bd26a931b88db3a852404d..f02e2421ac00ef243e8adc57bed257cbd0b7f830 100644 (file)
@@ -66,7 +66,10 @@ usage:
        usage_with_options(builtin_hook_run_usage, run_options);
 }
 
-int cmd_hook(int argc, const char **argv, const char *prefix)
+int cmd_hook(int argc,
+            const char **argv,
+            const char *prefix,
+            struct repository *repo UNUSED)
 {
        parse_opt_subcommand_fn *fn = NULL;
        struct option builtin_hook_options[] = {
index fd968d673d22d8593e0d18c32b41ad3760d0ba3e..3207130bfee454bb7ccda2cc09c35917b735fd48 100644 (file)
@@ -1718,7 +1718,10 @@ static void show_pack_info(int stat_only)
        free(chain_histogram);
 }
 
-int cmd_index_pack(int argc, const char **argv, const char *prefix)
+int cmd_index_pack(int argc,
+                  const char **argv,
+                  const char *prefix,
+                  struct repository *repo UNUSED)
 {
        int i, fix_thin_pack = 0, verify = 0, stat_only = 0, rev_index;
        const char *curr_index;
index 582dcf20f862fb87a967bcdbb121199007a42b1c..94bd6075095ec391164bb33516f64ac2992cec3a 100644 (file)
@@ -70,7 +70,10 @@ static const char *const init_db_usage[] = {
  * On the other hand, it might just make lookup slower and messier. You
  * be the judge.  The default case is to have one DB per managed directory.
  */
-int cmd_init_db(int argc, const char **argv, const char *prefix)
+int cmd_init_db(int argc,
+               const char **argv,
+               const char *prefix,
+               struct repository *repo UNUSED)
 {
        const char *git_dir;
        const char *real_git_dir = NULL;
index 1d969494cf54712d906947a9e6e591f2ecbfce7e..fb93e54e5ea613cdd85ce14a936f553687aa75ce 100644 (file)
@@ -188,7 +188,10 @@ static void interpret_trailers(const struct process_trailer_options *opts,
        strbuf_release(&sb);
 }
 
-int cmd_interpret_trailers(int argc, const char **argv, const char *prefix)
+int cmd_interpret_trailers(int argc,
+                          const char **argv,
+                          const char *prefix,
+                          struct repository *repo UNUSED)
 {
        struct process_trailer_options opts = PROCESS_TRAILER_OPTIONS_INIT;
        LIST_HEAD(trailers);
index 36769bab3b69a97744b6fe92437f7b06ce5d62c6..67140575f4b351c26dd74f44e1164e833ed2e9d9 100644 (file)
@@ -637,7 +637,10 @@ static int git_log_config(const char *var, const char *value,
        return git_diff_ui_config(var, value, ctx, cb);
 }
 
-int cmd_whatchanged(int argc, const char **argv, const char *prefix)
+int cmd_whatchanged(int argc,
+                   const char **argv,
+                   const char *prefix,
+                   struct repository *repo UNUSED)
 {
        struct log_config cfg;
        struct rev_info rev;
@@ -758,7 +761,10 @@ static void show_setup_revisions_tweak(struct rev_info *rev)
                rev->diffopt.output_format = DIFF_FORMAT_PATCH;
 }
 
-int cmd_show(int argc, const char **argv, const char *prefix)
+int cmd_show(int argc,
+            const char **argv,
+            const char *prefix,
+            struct repository *repo UNUSED)
 {
        struct log_config cfg;
        struct rev_info rev;
@@ -874,7 +880,10 @@ int cmd_show(int argc, const char **argv, const char *prefix)
 /*
  * This is equivalent to "git log -g --abbrev-commit --pretty=oneline"
  */
-int cmd_log_reflog(int argc, const char **argv, const char *prefix)
+int cmd_log_reflog(int argc,
+                  const char **argv,
+                  const char *prefix,
+                  struct repository *repo UNUSED)
 {
        struct log_config cfg;
        struct rev_info rev;
@@ -916,7 +925,10 @@ static void log_setup_revisions_tweak(struct rev_info *rev)
                diff_merges_default_to_first_parent(rev);
 }
 
-int cmd_log(int argc, const char **argv, const char *prefix)
+int cmd_log(int argc,
+           const char **argv,
+           const char *prefix,
+           struct repository *repo UNUSED)
 {
        struct log_config cfg;
        struct rev_info rev;
@@ -1986,7 +1998,10 @@ static void infer_range_diff_ranges(struct strbuf *r1,
        }
 }
 
-int cmd_format_patch(int argc, const char **argv, const char *prefix)
+int cmd_format_patch(int argc,
+                    const char **argv,
+                    const char *prefix,
+                    struct repository *repo UNUSED)
 {
        struct format_config cfg;
        struct commit *commit;
@@ -2619,7 +2634,10 @@ static void print_commit(char sign, struct commit *commit, int verbose,
        }
 }
 
-int cmd_cherry(int argc, const char **argv, const char *prefix)
+int cmd_cherry(int argc,
+              const char **argv,
+              const char *prefix,
+              struct repository *repo UNUSED)
 {
        struct rev_info revs;
        struct patch_ids ids;
index 6eeb5cba783d8dd55a9a0dce77818293bbd6699d..7f45cb62cf63d5c33e0a1b573391b75ae062cfbc 100644 (file)
@@ -561,7 +561,10 @@ static int option_parse_exclude_standard(const struct option *opt,
        return 0;
 }
 
-int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix)
+int cmd_ls_files(int argc,
+                const char **argv,
+                const char *cmd_prefix,
+                struct repository *repo UNUSED)
 {
        int require_work_tree = 0, show_tag = 0, i;
        char *max_prefix;
index 0a491595ca831c3caeb9721efd322f3027c1983d..f2c2854d0c3ab940d2088ffc989c6e97a7cc52b9 100644 (file)
@@ -37,7 +37,10 @@ static int tail_match(const struct strvec *pattern, const char *path)
        return 0;
 }
 
-int cmd_ls_remote(int argc, const char **argv, const char *prefix)
+int cmd_ls_remote(int argc,
+                 const char **argv,
+                 const char *prefix,
+                 struct repository *repo UNUSED)
 {
        const char *dest = NULL;
        unsigned flags = 0;
index bf372c67d773bd4ce5fe9285b818bba1372595c2..363cb948d92dbd3880f1b4c0d603342eeecb8a7a 100644 (file)
@@ -329,7 +329,10 @@ static struct ls_tree_cmdmode_to_fmt ls_tree_cmdmode_format[] = {
        },
 };
 
-int cmd_ls_tree(int argc, const char **argv, const char *prefix)
+int cmd_ls_tree(int argc,
+               const char **argv,
+               const char *prefix,
+               struct repository *repo UNUSED)
 {
        struct object_id oid;
        struct tree *tree;
index 53a22645da58b8c18bb825ca9012e2f072cbf3a3..00bfcd1afa05adf3db40c26771dd1b8ec98c0e28 100644 (file)
@@ -48,7 +48,10 @@ static int parse_opt_quoted_cr(const struct option *opt, const char *arg, int un
        return 0;
 }
 
-int cmd_mailinfo(int argc, const char **argv, const char *prefix)
+int cmd_mailinfo(int argc,
+                const char **argv,
+                const char *prefix,
+                struct repository *repo UNUSED)
 {
        struct metainfo_charset meta_charset;
        struct mailinfo mi;
index fe6dbc5d0538912cfb3b620d1b337de16d91fd5c..b8f7150ce9a5b47bbb15a13f392bdd8698efe2a9 100644 (file)
@@ -269,7 +269,10 @@ out:
        return ret;
 }
 
-int cmd_mailsplit(int argc, const char **argv, const char *prefix)
+int cmd_mailsplit(int argc,
+                 const char **argv,
+                 const char *prefix,
+                 struct repository *repo UNUSED)
 {
        int nr = 0, nr_prec = 4, num = 0;
        int allow_bare = 0;
index 5a8e72950298c254d430664c6e931ca13c699590..afeae8d8346c610b7e2231f751b74dfa1352811f 100644 (file)
@@ -143,7 +143,10 @@ static int handle_fork_point(int argc, const char **argv)
        return 0;
 }
 
-int cmd_merge_base(int argc, const char **argv, const char *prefix)
+int cmd_merge_base(int argc,
+                  const char **argv,
+                  const char *prefix,
+                  struct repository *repo UNUSED)
 {
        struct commit **rev;
        int rev_nr = 0;
index 1f987334a31b0e19904825297c1bb0d37a1fc2fe..f785813ddae2f29b843a19ac152a378414fec5db 100644 (file)
@@ -53,7 +53,10 @@ static int diff_algorithm_cb(const struct option *opt,
        return 0;
 }
 
-int cmd_merge_file(int argc, const char **argv, const char *prefix)
+int cmd_merge_file(int argc,
+                  const char **argv,
+                  const char *prefix,
+                  struct repository *repo UNUSED)
 {
        const char *names[3] = { 0 };
        mmfile_t mmfs[3] = { 0 };
index 0fabe3f6bb2092e9e9eec8ee81f3784ecd1c7da5..1309a8ff4718295cbc4e5e9bb17dabb8e551200d 100644 (file)
@@ -73,7 +73,10 @@ static void merge_all(void)
        }
 }
 
-int cmd_merge_index(int argc, const char **argv, const char *prefix UNUSED)
+int cmd_merge_index(int argc,
+                   const char **argv,
+                   const char *prefix UNUSED,
+                   struct repository *repo UNUSED)
 {
        int i, force_file = 0;
 
index 932924e5d0e573959e2d8c70168f77224de45bc8..62267f12dd87e7ecb09355fa3747de190c6f71d7 100644 (file)
 static const char builtin_merge_ours_usage[] =
        "git merge-ours <base>... -- HEAD <remote>...";
 
-int cmd_merge_ours(int argc, const char **argv, const char *prefix UNUSED)
+int cmd_merge_ours(int argc,
+                  const char **argv,
+                  const char *prefix UNUSED,
+                  struct repository *repo UNUSED)
 {
        if (argc == 2 && !strcmp(argv[1], "-h"))
                usage(builtin_merge_ours_usage);
index e951b09805dd872ea3a8eeadf056c4d069483bd5..2bd3fb0e553db9541b65d584a6568c7eaa67e5d3 100644 (file)
@@ -21,7 +21,10 @@ static char *better_branch_name(const char *branch)
        return xstrdup(name ? name : branch);
 }
 
-int cmd_merge_recursive(int argc, const char **argv, const char *prefix UNUSED)
+int cmd_merge_recursive(int argc,
+                       const char **argv,
+                       const char *prefix UNUSED,
+                       struct repository *repo UNUSED)
 {
        struct object_id bases[21];
        unsigned bases_count = 0;
index 9bca9b5f33c7c1bd40564b8936004224f17b482e..8751d86fd0fd4acadabb6a1e77ff64b837408a44 100644 (file)
@@ -526,7 +526,10 @@ static int real_merge(struct merge_tree_options *o,
        return !result.clean; /* result.clean < 0 handled above */
 }
 
-int cmd_merge_tree(int argc, const char **argv, const char *prefix)
+int cmd_merge_tree(int argc,
+                  const char **argv,
+                  const char *prefix,
+                  struct repository *repo UNUSED)
 {
        struct merge_tree_options o = { .show_messages = -1 };
        struct strvec xopts = STRVEC_INIT;
index 662a49a0e8c303f763012180df75cb6150880f60..fd6dc00d6c0d238fa5e2e053558a332e53b5bd34 100644 (file)
@@ -1275,7 +1275,10 @@ static int merging_a_throwaway_tag(struct commit *commit)
        return is_throwaway_tag;
 }
 
-int cmd_merge(int argc, const char **argv, const char *prefix)
+int cmd_merge(int argc,
+             const char **argv,
+             const char *prefix,
+             struct repository *repo UNUSED)
 {
        struct object_id result_tree, stash, head_oid;
        struct commit *head_commit;
@@ -1347,7 +1350,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
                                        REF_NO_DEREF);
 
                /* Invoke 'git reset --merge' */
-               ret = cmd_reset(nargc, nargv, prefix);
+               ret = cmd_reset(nargc, nargv, prefix, the_repository);
 
                if (!is_null_oid(&stash_oid)) {
                        oid_to_hex_r(stash_oid_hex, &stash_oid);
@@ -1379,7 +1382,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
                        die(_("There is no merge in progress (MERGE_HEAD missing)."));
 
                /* Invoke 'git commit' */
-               ret = cmd_commit(nargc, nargv, prefix);
+               ret = cmd_commit(nargc, nargv, prefix, the_repository);
                goto done;
        }
 
index c6b644219fb19e2faeba612cbf74c7e3bd55b998..5cd8a3e6fa06a3f2df4fd8b7c3e896b19f639c57 100644 (file)
@@ -71,7 +71,10 @@ static int verify_object_in_tag(struct object_id *tagged_oid, int *tagged_type)
        return ret;
 }
 
-int cmd_mktag(int argc, const char **argv, const char *prefix)
+int cmd_mktag(int argc,
+             const char **argv,
+             const char *prefix,
+             struct repository *repo UNUSED)
 {
        static struct option builtin_mktag_options[] = {
                OPT_BOOL(0, "strict", &option_strict,
index 9a22d4e27735d55265fbf1a16cec8aeb66c27883..72a1af1bca5e4bf2327b1bebeae00aab4e0d5015 100644 (file)
@@ -150,7 +150,10 @@ static void mktree_line(char *buf, int nul_term_line, int allow_missing)
        free(to_free);
 }
 
-int cmd_mktree(int ac, const char **av, const char *prefix)
+int cmd_mktree(int ac,
+              const char **av,
+              const char *prefix,
+              struct repository *repo UNUSED)
 {
        struct strbuf sb = STRBUF_INIT;
        struct object_id oid;
@@ -199,5 +202,6 @@ int cmd_mktree(int ac, const char **av, const char *prefix)
                used=0; /* reset tree entry buffer for re-use in batch mode */
        }
        strbuf_release(&sb);
+
        return 0;
 }
index 8805cbbeb3be3e10e073335af890f39daef6e003..154fc77075f11d8b3e61f3d1773bd93c6eac89e2 100644 (file)
@@ -267,8 +267,10 @@ static int cmd_multi_pack_index_repack(int argc, const char **argv,
                           (size_t)opts.batch_size, opts.flags);
 }
 
-int cmd_multi_pack_index(int argc, const char **argv,
-                        const char *prefix)
+int cmd_multi_pack_index(int argc,
+                        const char **argv,
+                        const char *prefix,
+                        struct repository *repo UNUSED)
 {
        int res;
        parse_opt_subcommand_fn *fn = NULL;
index 6c69033c5f51e377d2b58d46eb3867fcfd8fdbba..6e2eb9cf4b80c2f4ed09ac66435e18ffdfa02609 100644 (file)
@@ -178,7 +178,10 @@ static void remove_empty_src_dirs(const char **src_dir, size_t src_dir_nr)
        strbuf_release(&a_src_dir);
 }
 
-int cmd_mv(int argc, const char **argv, const char *prefix)
+int cmd_mv(int argc,
+          const char **argv,
+          const char *prefix,
+          struct repository *repo UNUSED)
 {
        int i, flags, gitmodules_modified = 0;
        int verbose = 0, show_only = 0, force = 0, ignore_errors = 0, ignore_sparse = 0;
index a468ef84c37f84b844b790e2edc34b21ca43a3f8..19d92fb382d495ff45a976d6a4d8953ce0b2f8dc 100644 (file)
@@ -558,7 +558,10 @@ static void name_rev_line(char *p, struct name_ref_data *data)
        strbuf_release(&buf);
 }
 
-int cmd_name_rev(int argc, const char **argv, const char *prefix)
+int cmd_name_rev(int argc,
+                const char **argv,
+                const char *prefix,
+                struct repository *repo UNUSED)
 {
        struct mem_pool string_pool;
        struct object_array revs = OBJECT_ARRAY_INIT;
index 04f9dfb7fbd4ceec48ba4211db9ea1c8d3d177f6..49d8364af6065eae342fdf326e95f157eb45fe96 100644 (file)
@@ -1096,7 +1096,10 @@ static int get_ref(int argc, const char **argv, const char *prefix)
        return 0;
 }
 
-int cmd_notes(int argc, const char **argv, const char *prefix)
+int cmd_notes(int argc,
+             const char **argv,
+             const char *prefix,
+             struct repository *repo UNUSED)
 {
        const char *override_notes_ref = NULL;
        parse_opt_subcommand_fn *fn = NULL;
index 778be80f5646d137de9ab83ee68a966d71c64858..127972f3cdfdbfffb66f25075eb0c4a8a2894414 100644 (file)
@@ -4284,7 +4284,10 @@ static int option_parse_cruft_expiration(const struct option *opt UNUSED,
        return 0;
 }
 
-int cmd_pack_objects(int argc, const char **argv, const char *prefix)
+int cmd_pack_objects(int argc,
+                    const char **argv,
+                    const char *prefix,
+                    struct repository *repo UNUSED)
 {
        int use_internal_rev_list = 0;
        int shallow = 0;
index dd9bf35f5b8c087ef286ac4f080a3ba8bbbf0ba8..84f0d83affb1ea251f3fd02995a1e4276b21b3ca 100644 (file)
@@ -561,11 +561,8 @@ static void load_all(void)
        }
 }
 
-int cmd_pack_redundant(int argc, const char **argv, const char *prefix UNUSED)
-{
-       int i;
-       int i_still_use_this = 0;
-       struct pack_list *min = NULL, *red, *pl;
+int cmd_pack_redundant(int argc, const char **argv, const char *prefix UNUSED, struct repository *repo UNUSED) {
+       int i; int i_still_use_this = 0; struct pack_list *min = NULL, *red, *pl;
        struct llist *ignore;
        struct object_id *oid;
        char buf[GIT_MAX_HEXSZ + 2]; /* hex hash + \n + \0 */
index db4082566634cbf5bdbb081d0807b0a82be7645e..67dabb397568b23e6b2267b65352e7e62df6d021 100644 (file)
@@ -11,7 +11,10 @@ static char const * const pack_refs_usage[] = {
        NULL
 };
 
-int cmd_pack_refs(int argc, const char **argv, const char *prefix)
+int cmd_pack_refs(int argc,
+                 const char **argv,
+                 const char *prefix,
+                 struct repository *repo UNUSED)
 {
        struct ref_exclusions excludes = REF_EXCLUSIONS_INIT;
        struct string_list included_refs = STRING_LIST_INIT_NODUP;
index 35c1179f7e94ba055e40f45c775bcda008632068..fa31a1b7a605b9bf11fff07c84230c3ce442ab2f 100644 (file)
@@ -260,7 +260,10 @@ static int git_patch_id_config(const char *var, const char *value,
        return git_default_config(var, value, ctx, cb);
 }
 
-int cmd_patch_id(int argc, const char **argv, const char *prefix)
+int cmd_patch_id(int argc,
+                const char **argv,
+                const char *prefix,
+                struct repository *repo UNUSED)
 {
        /* if nothing is set, default to unstable */
        struct patch_id_opts config = {0, 0};
index ca3578e158840148aea2b074a3d44fdc64332b58..4d63f26b0a120caf54ec8ca404be7c0d3d877a8d 100644 (file)
@@ -8,7 +8,10 @@ static const char * const prune_packed_usage[] = {
        NULL
 };
 
-int cmd_prune_packed(int argc, const char **argv, const char *prefix)
+int cmd_prune_packed(int argc,
+                    const char **argv,
+                    const char *prefix,
+                    struct repository *repo UNUSED)
 {
        int opts = isatty(2) ? PRUNE_PACKED_VERBOSE : 0;
        const struct option prune_packed_options[] = {
index 57fe31467fe5ac9768f1b04f7c7e6dd3e9409468..cbd4c38fa0ac50313dfe9ae1eca4d8b8fd68a0fe 100644 (file)
@@ -147,7 +147,10 @@ static void remove_temporary_files(const char *path)
        closedir(dir);
 }
 
-int cmd_prune(int argc, const char **argv, const char *prefix)
+int cmd_prune(int argc,
+             const char **argv,
+             const char *prefix,
+             struct repository *repo UNUSED)
 {
        struct rev_info revs;
        int exclude_promisor_objects = 0;
index 4c54d8196fac6e629afa486bd6fe7c9d4b6e0945..1a926f0b0d74903571c062a9e861f1f1af19280e 100644 (file)
@@ -977,7 +977,10 @@ static void show_advice_pull_non_ff(void)
                 "invocation.\n"));
 }
 
-int cmd_pull(int argc, const char **argv, const char *prefix)
+int cmd_pull(int argc,
+            const char **argv,
+            const char *prefix,
+            struct repository *repository UNUSED)
 {
        const char *repo, **refspecs;
        struct oid_array merge_heads = OID_ARRAY_INIT;
index 7a67398124f93121a85f5722d3e06413dcc31ff5..9636ad52f4d685a8397f534e49a53529a8ee806f 100644 (file)
@@ -546,7 +546,10 @@ static int git_push_config(const char *k, const char *v,
        return git_default_config(k, v, ctx, NULL);
 }
 
-int cmd_push(int argc, const char **argv, const char *prefix)
+int cmd_push(int argc,
+            const char **argv,
+            const char *prefix,
+            struct repository *repository UNUSED)
 {
        int flags = 0;
        int tags = 0;
index f02cbac087db403cedae2e4b5269e5258059677f..3e67259aecc1e44722b858845c0af9bfac0e4133 100644 (file)
@@ -13,7 +13,10 @@ N_("git range-diff [<options>] <base> <old-tip> <new-tip>"),
 NULL
 };
 
-int cmd_range_diff(int argc, const char **argv, const char *prefix)
+int cmd_range_diff(int argc,
+                  const char **argv,
+                  const char *prefix,
+                  struct repository *repo UNUSED)
 {
        struct diff_options diffopt = { NULL };
        struct strvec other_arg = STRVEC_INIT;
index a8cf8504b8a368083d670ccd57bbdf51f84c6884..89410db6a7aac02227e0367fa24d850a51416dde 100644 (file)
@@ -108,7 +108,10 @@ static int git_read_tree_config(const char *var, const char *value,
        return git_default_config(var, value, ctx, cb);
 }
 
-int cmd_read_tree(int argc, const char **argv, const char *cmd_prefix)
+int cmd_read_tree(int argc,
+                 const char **argv,
+                 const char *cmd_prefix,
+                 struct repository *repo UNUSED)
 {
        int i, stage = 0;
        struct object_id oid;
index a2c96c080e1526f6fb279bd8eb76c2f277073e3d..727d9df847f30de9ff7bb4bd27d05c29bc49bbb4 100644 (file)
@@ -1063,7 +1063,10 @@ static int check_exec_cmd(const char *cmd)
        return 0;
 }
 
-int cmd_rebase(int argc, const char **argv, const char *prefix)
+int cmd_rebase(int argc,
+              const char **argv,
+              const char *prefix,
+              struct repository *repo UNUSED)
 {
        struct rebase_options options = REBASE_OPTIONS_INIT;
        const char *branch_name;
index 3f35140e48910034b21544b428302fa11ae405c9..36a6229c2a4f35e5eac8e31e97526c7e654ce3c0 100644 (file)
@@ -2480,7 +2480,10 @@ static int delete_only(struct command *commands)
        return 1;
 }
 
-int cmd_receive_pack(int argc, const char **argv, const char *prefix)
+int cmd_receive_pack(int argc,
+                    const char **argv,
+                    const char *prefix,
+                    struct repository *repo UNUSED)
 {
        int advertise_refs = 0;
        struct command *commands;
index 0d2ff95c6e70893d2c965348a23c3b888ef283b6..6250f5ad49fe7c59100b99b46b16439d37e4f0b8 100644 (file)
@@ -244,7 +244,7 @@ static int cmd_reflog_show(int argc, const char **argv, const char *prefix)
                      PARSE_OPT_KEEP_DASHDASH | PARSE_OPT_KEEP_ARGV0 |
                      PARSE_OPT_KEEP_UNKNOWN_OPT);
 
-       return cmd_log_reflog(argc, argv, prefix);
+       return cmd_log_reflog(argc, argv, prefix, the_repository);
 }
 
 static int show_reflog(const char *refname, void *cb_data UNUSED)
@@ -447,7 +447,10 @@ static int cmd_reflog_exists(int argc, const char **argv, const char *prefix)
  * main "reflog"
  */
 
-int cmd_reflog(int argc, const char **argv, const char *prefix)
+int cmd_reflog(int argc,
+              const char **argv,
+              const char *prefix,
+              struct repository *repository)
 {
        parse_opt_subcommand_fn *fn = NULL;
        struct option options[] = {
@@ -466,5 +469,5 @@ int cmd_reflog(int argc, const char **argv, const char *prefix)
        if (fn)
                return fn(argc - 1, argv + 1, prefix);
        else
-               return cmd_log_reflog(argc, argv, prefix);
+               return cmd_log_reflog(argc, argv, prefix, repository);
 }
index 131f98be986d3fea80068c9975d0db157d9a9900..70bca724d2a5442cd8efb8b78d2b2dc4c15a6e30 100644 (file)
@@ -90,7 +90,10 @@ static int cmd_refs_verify(int argc, const char **argv, const char *prefix)
        return ret;
 }
 
-int cmd_refs(int argc, const char **argv, const char *prefix)
+int cmd_refs(int argc,
+            const char **argv,
+            const char *prefix,
+            struct repository *repo UNUSED)
 {
        const char * const refs_usage[] = {
                REFS_MIGRATE_USAGE,
index 282782eccdd85691d238e6bd3f3e5b5350304927..33c8ae0fc7d638461e11b01b1c31d291efdacba9 100644 (file)
@@ -195,7 +195,10 @@ static int command_loop(const char *child)
        }
 }
 
-int cmd_remote_ext(int argc, const char **argv, const char *prefix)
+int cmd_remote_ext(int argc,
+                  const char **argv,
+                  const char *prefix,
+                  struct repository *repo UNUSED)
 {
        BUG_ON_NON_EMPTY_PREFIX(prefix);
 
index 9020fab9c580b304d5099e12d35094eb1d1f3874..ae896eda57b86d110d6cb2f3aec1cc8e69ddb508 100644 (file)
@@ -53,7 +53,10 @@ static void command_loop(int input_fd, int output_fd)
        }
 }
 
-int cmd_remote_fd(int argc, const char **argv, const char *prefix)
+int cmd_remote_fd(int argc,
+                 const char **argv,
+                 const char *prefix,
+                 struct repository *repo UNUSED)
 {
        int input_fd = -1;
        int output_fd = -1;
index d1f9292ed2b292afb763618ba3103e2d3c6f519d..1ac7e5fbce393aba0778d86fcb076d074233384f 100644 (file)
@@ -1754,7 +1754,10 @@ out:
        return 0;
 }
 
-int cmd_remote(int argc, const char **argv, const char *prefix)
+int cmd_remote(int argc,
+              const char **argv,
+              const char *prefix,
+              struct repository *repo UNUSED)
 {
        parse_opt_subcommand_fn *fn = NULL;
        struct option options[] = {
index 62cfa50c50f893406803cbbedef711f35167cb14..a6f2a4de1b8c4c8cae7593d6a82c6306edcab250 100644 (file)
@@ -1116,7 +1116,10 @@ static const char *find_pack_prefix(const char *packdir, const char *packtmp)
        return pack_prefix;
 }
 
-int cmd_repack(int argc, const char **argv, const char *prefix)
+int cmd_repack(int argc,
+              const char **argv,
+              const char *prefix,
+              struct repository *repo UNUSED)
 {
        struct child_process cmd = CHILD_PROCESS_INIT;
        struct string_list_item *item;
index 34cc4672bc11a2aa94d0d387d175b044e7ab5fb0..293ae6d327f8ec4eec2badf03a40590cbfddafcd 100644 (file)
@@ -545,7 +545,10 @@ static int convert_graft_file(int force)
        return -1;
 }
 
-int cmd_replace(int argc, const char **argv, const char *prefix)
+int cmd_replace(int argc,
+               const char **argv,
+               const char *prefix,
+               struct repository *repo UNUSED)
 {
        int force = 0;
        int raw = 0;
index 138198ce9ca20e611e3d3866e191ad21f311879c..c8e9098fc1208de632cb33c6bcdd32824f5fb58c 100644 (file)
@@ -274,7 +274,10 @@ static struct commit *pick_regular_commit(struct commit *pickme,
        return create_commit(result->tree, pickme, replayed_base);
 }
 
-int cmd_replay(int argc, const char **argv, const char *prefix)
+int cmd_replay(int argc,
+              const char **argv,
+              const char *prefix,
+              struct repository *repo UNUSED)
 {
        const char *advance_name_opt = NULL;
        char *advance_name = NULL;
index 81b65ffa39c2780f9de56d8143d4c53373760e12..ae345155834ce4df5ee1bd1f7dee8aa9e10ea14e 100644 (file)
@@ -48,7 +48,10 @@ static int diff_two(const char *file1, const char *label1,
        return ret;
 }
 
-int cmd_rerere(int argc, const char **argv, const char *prefix)
+int cmd_rerere(int argc,
+              const char **argv,
+              const char *prefix,
+              struct repository *repo UNUSED)
 {
        struct string_list merge_rr = STRING_LIST_INIT_DUP;
        int i, autoupdate = -1, flags = 0;
index 5f941fb3a29cce568608f7a07b6f60a683479748..75529072606f6c25df9dc1c3b322d5934bec755c 100644 (file)
@@ -330,7 +330,10 @@ static int git_reset_config(const char *var, const char *value,
        return git_default_config(var, value, ctx, cb);
 }
 
-int cmd_reset(int argc, const char **argv, const char *prefix)
+int cmd_reset(int argc,
+             const char **argv,
+             const char *prefix,
+             struct repository *repo UNUSED)
 {
        int reset_type = NONE, update_ref_status = 0, quiet = 0;
        int no_refresh = 0;
index 97d077a994363f7a7f8f0ee49deb6bd04324b4ea..a4186d47ce347281d02584db4492d1d3aa0e1e8e 100644 (file)
@@ -513,7 +513,10 @@ static int try_bitmap_disk_usage(struct rev_info *revs,
        return 0;
 }
 
-int cmd_rev_list(int argc, const char **argv, const char *prefix)
+int cmd_rev_list(int argc,
+                const char **argv,
+                const char *prefix,
+                struct repository *repo UNUSED)
 {
        struct rev_info revs;
        struct rev_list_info info;
index 4285dc34a7b553b808993973bb7ce2102bb85fae..26190aaa3eda1ea3850d46fa23f7496234952d93 100644 (file)
@@ -688,7 +688,10 @@ static void print_path(const char *path, const char *prefix, enum format_type fo
        free(cwd);
 }
 
-int cmd_rev_parse(int argc, const char **argv, const char *prefix)
+int cmd_rev_parse(int argc,
+                 const char **argv,
+                 const char *prefix,
+                 struct repository *repo UNUSED)
 {
        int i, as_is = 0, verify = 0, quiet = 0, revs_count = 0, type = 0;
        const struct git_hash_algo *output_algo = NULL;
index 7bf2b4e11d6149d5d5e9d07cf810d56272447776..5f2ec3ade73cf3593d18f57a543608a23a91fe2d 100644 (file)
@@ -261,7 +261,10 @@ static int run_sequencer(int argc, const char **argv, const char *prefix,
        return sequencer_pick_revisions(the_repository, opts);
 }
 
-int cmd_revert(int argc, const char **argv, const char *prefix)
+int cmd_revert(int argc,
+              const char **argv,
+              const char *prefix,
+              struct repository *repo UNUSED)
 {
        struct replay_opts opts = REPLAY_OPTS_INIT;
        int res;
@@ -275,7 +278,10 @@ int cmd_revert(int argc, const char **argv, const char *prefix)
        return res;
 }
 
-int cmd_cherry_pick(int argc, const char **argv, const char *prefix)
+int cmd_cherry_pick(int argc,
+const char **argv,
+const char *prefix,
+struct repository *repo UNUSED)
 {
        struct replay_opts opts = REPLAY_OPTS_INIT;
        int res;
index 0e79cbab62b86a999bd758afc3b52e79eb59241f..59077efa4b495db0bc0934bd2231f1866085cfb3 100644 (file)
@@ -261,7 +261,10 @@ static struct option builtin_rm_options[] = {
        OPT_END(),
 };
 
-int cmd_rm(int argc, const char **argv, const char *prefix)
+int cmd_rm(int argc,
+          const char **argv,
+          const char *prefix,
+          struct repository *repo UNUSED)
 {
        struct lock_file lock_file = LOCK_INIT;
        int i, ret = 0;
index 17cae6bbbdf298918ba75e7e78c73b1e5d154778..a4925ed5fd127bd62a4ba29ee7cca8c4ce126727 100644 (file)
@@ -147,7 +147,10 @@ static int send_pack_config(const char *k, const char *v,
        return git_default_config(k, v, ctx, cb);
 }
 
-int cmd_send_pack(int argc, const char **argv, const char *prefix)
+int cmd_send_pack(int argc,
+                 const char **argv,
+                 const char *prefix,
+                 struct repository *repo UNUSED)
 {
        struct refspec rs = REFSPEC_INIT_PUSH;
        const char *remote_name = NULL;
index b529608c9236b7df2dee3dfa50a3337d8a92ca86..70eb789033450c4a1e89c2ebf5b9bd4d06c5635f 100644 (file)
@@ -378,7 +378,10 @@ void shortlog_finish_setup(struct shortlog *log)
        string_list_sort(&log->trailers);
 }
 
-int cmd_shortlog(int argc, const char **argv, const char *prefix)
+int cmd_shortlog(int argc,
+                const char **argv,
+                const char *prefix,
+                struct repository *repo UNUSED)
 {
        struct shortlog log = { STRING_LIST_INIT_NODUP };
        struct rev_info rev;
index 29237f653d83a7abbcb22b0f37fc241d223d8021..05c10628df949687e243b6c9eca301080d616dab 100644 (file)
@@ -632,7 +632,10 @@ static int parse_reflog_param(const struct option *opt, const char *arg,
        return 0;
 }
 
-int cmd_show_branch(int ac, const char **av, const char *prefix)
+int cmd_show_branch(int ac,
+               const char **av,
+               const char *prefix,
+               struct repository *repo UNUSED)
 {
        struct commit *rev[MAX_REVS], *commit;
        char *reflog_msg[MAX_REVS] = {0};
index 540dc3dad1c1e3e4308c5058151dfb1dcaee6d21..9e1f7ac9ca5582701e16d5498073eff9fd1ca06f 100644 (file)
@@ -11,7 +11,10 @@ static const char *const show_index_usage[] = {
        NULL
 };
 
-int cmd_show_index(int argc, const char **argv, const char *prefix)
+int cmd_show_index(int argc,
+                  const char **argv,
+                  const char *prefix,
+                  struct repository *repo UNUSED)
 {
        int i;
        unsigned nr;
index f5899ce9ff7b5547c4a7e0f6aa4f6a2cb814e01f..6ee05f09a694dcca2292a40bf2efa39c5246e056 100644 (file)
@@ -287,7 +287,10 @@ static int exclude_existing_callback(const struct option *opt, const char *arg,
        return 0;
 }
 
-int cmd_show_ref(int argc, const char **argv, const char *prefix)
+int cmd_show_ref(int argc,
+const char **argv,
+const char *prefix,
+struct repository *repo UNUSED)
 {
        struct exclude_existing_options exclude_existing_opts = {0};
        struct patterns_options patterns_opts = {0};
index 2604ab04df5aee8046b7511587cb0c8cda768ddb..23f1548fe54ab177fee4ca454bc1ee129ddccade 100644 (file)
@@ -1030,7 +1030,10 @@ static int sparse_checkout_check_rules(int argc, const char **argv, const char *
        return ret;
 }
 
-int cmd_sparse_checkout(int argc, const char **argv, const char *prefix)
+int cmd_sparse_checkout(int argc,
+                       const char **argv,
+                       const char *prefix,
+                       struct repository *repo UNUSED)
 {
        parse_opt_subcommand_fn *fn = NULL;
        struct option builtin_sparse_checkout_options[] = {
index fcfd97972a487defda3e5279dbb7a7e89f8bcc0f..518d297b47b3d76f05a210f2780e4be185639b9c 100644 (file)
@@ -1871,7 +1871,10 @@ static int save_stash(int argc, const char **argv, const char *prefix)
        return ret;
 }
 
-int cmd_stash(int argc, const char **argv, const char *prefix)
+int cmd_stash(int argc,
+             const char **argv,
+             const char *prefix,
+             struct repository *repo UNUSED)
 {
        pid_t pid = getpid();
        const char *index_file;
index e5626e5126695b43aea014e3852ea325f055e62b..674ef9397697f701f58e7497b3192d07e508d243 100644 (file)
@@ -29,7 +29,10 @@ enum stripspace_mode {
        COMMENT_LINES
 };
 
-int cmd_stripspace(int argc, const char **argv, const char *prefix)
+int cmd_stripspace(int argc,
+                  const char **argv,
+                  const char *prefix,
+                  struct repository *repo UNUSED)
 {
        struct strbuf buf = STRBUF_INIT;
        enum stripspace_mode mode = STRIP_DEFAULT;
index 85fb23dee84c18b850ee21ff269910d3ed426c7d..947bd9d0f6a79e909e49dc5f1528adc7f18fe585 100644 (file)
@@ -3528,7 +3528,10 @@ cleanup:
        return ret;
 }
 
-int cmd_submodule__helper(int argc, const char **argv, const char *prefix)
+int cmd_submodule__helper(int argc,
+                         const char **argv,
+                         const char *prefix,
+                         struct repository *repo UNUSED)
 {
        parse_opt_subcommand_fn *fn = NULL;
        const char *const usage[] = {
index 81abdd170fe73e2a5aa836cdf3069e0eb426c802..9bc702294684983e5c6a7e6396989f0c864286b9 100644 (file)
@@ -41,7 +41,10 @@ static int check_symref(const char *HEAD, int quiet, int shorten, int recurse, i
        return 0;
 }
 
-int cmd_symbolic_ref(int argc, const char **argv, const char *prefix)
+int cmd_symbolic_ref(int argc,
+                    const char **argv,
+                    const char *prefix,
+                    struct repository *repo UNUSED)
 {
        int quiet = 0, delete = 0, shorten = 0, recurse = 1, ret = 0;
        const char *msg = NULL;
index a1fb218512cc1a072682a33411a6da29313e2446..a80838eb8e0ddf14532899a610d7316e40c1dab6 100644 (file)
@@ -457,7 +457,10 @@ static int strbuf_check_tag_ref(struct strbuf *sb, const char *name)
        return check_refname_format(sb->buf, 0);
 }
 
-int cmd_tag(int argc, const char **argv, const char *prefix)
+int cmd_tag(int argc,
+           const char **argv,
+           const char *prefix,
+           struct repository *repo UNUSED)
 {
        struct strbuf buf = STRBUF_INIT;
        struct strbuf ref = STRBUF_INIT;
index c129e2bb6cbffaf80898c8a9c1c4e49fdeb001a4..97886840f8d111d33e90b35766a919857919c745 100644 (file)
@@ -25,7 +25,10 @@ static char *create_temp_file(struct object_id *oid)
        return path;
 }
 
-int cmd_unpack_file(int argc, const char **argv, const char *prefix UNUSED)
+int cmd_unpack_file(int argc,
+                   const char **argv,
+                   const char *prefix UNUSED,
+                   struct repository *repo UNUSED)
 {
        struct object_id oid;
 
index 08fa2a7a743dc91f8aa83cfc8021fce471a36791..3bcdaaeb5fa6322e5cf389e9aae03225708299fc 100644 (file)
@@ -601,7 +601,10 @@ static void unpack_all(void)
                die("unresolved deltas left after unpacking");
 }
 
-int cmd_unpack_objects(int argc, const char **argv, const char *prefix UNUSED)
+int cmd_unpack_objects(int argc,
+                      const char **argv,
+                      const char *prefix UNUSED,
+                      struct repository *repo UNUSED)
 {
        int i;
        struct object_id oid;
index 35a1f957adc8608613ec05b7ac3668048adef4e5..1d1d87d08e3431773fb9f038c7cac172a20a8ee6 100644 (file)
@@ -917,7 +917,10 @@ static enum parse_opt_result reupdate_callback(
        return 0;
 }
 
-int cmd_update_index(int argc, const char **argv, const char *prefix)
+int cmd_update_index(int argc,
+                    const char **argv,
+                    const char *prefix,
+                    struct repository *repo UNUSED)
 {
        int newfd, entries, has_errors = 0, nul_term_line = 0;
        enum uc_mode untracked_cache = UC_UNSPECIFIED;
index 8f31da9a4b78f4300ce71ada48587263e75af794..06826a90515e51fbcf90b423c4a5f7435c508f11 100644 (file)
@@ -713,7 +713,10 @@ static void update_refs_stdin(void)
        strbuf_release(&input);
 }
 
-int cmd_update_ref(int argc, const char **argv, const char *prefix)
+int cmd_update_ref(int argc,
+                  const char **argv,
+                  const char *prefix,
+                  struct repository *repo UNUSED)
 {
        const char *refname, *oldval;
        struct object_id oid, oldoid;
index 1dc3971edeb3837a1479ce519197880d28ba7699..a5b7d86727caa247126a19e046f526b7ab1e0abb 100644 (file)
@@ -9,7 +9,10 @@ static const char * const update_server_info_usage[] = {
        NULL
 };
 
-int cmd_update_server_info(int argc, const char **argv, const char *prefix)
+int cmd_update_server_info(int argc,
+                          const char **argv,
+                          const char *prefix,
+                          struct repository *repo UNUSED)
 {
        int force = 0;
        struct option options[] = {
index 1b09e5e1aa3f08e91bf6de731b111864ef405573..49d1bb7fb441cdc9d5e7405d143ecf0541f3df3c 100644 (file)
@@ -18,7 +18,10 @@ static const char deadchild[] =
 
 #define MAX_ARGS (64)
 
-int cmd_upload_archive_writer(int argc, const char **argv, const char *prefix)
+int cmd_upload_archive_writer(int argc,
+                             const char **argv,
+                             const char *prefix,
+                             struct repository *repo UNUSED)
 {
        struct strvec sent_argv = STRVEC_INIT;
        const char *arg_cmd = "argument ";
@@ -76,7 +79,10 @@ static ssize_t process_input(int child_fd, int band)
        return sz;
 }
 
-int cmd_upload_archive(int argc, const char **argv, const char *prefix)
+int cmd_upload_archive(int argc,
+const char **argv,
+const char *prefix,
+struct repository *repo UNUSED)
 {
        struct child_process writer = CHILD_PROCESS_INIT;
 
index 46d93278d9a2e42a2202b2bd484b9cba10caabd6..3b6c83fbce3684f627e2e86818671e9c0dab30e1 100644 (file)
@@ -17,7 +17,10 @@ static const char * const upload_pack_usage[] = {
        NULL
 };
 
-int cmd_upload_pack(int argc, const char **argv, const char *prefix)
+int cmd_upload_pack(int argc,
+                   const char **argv,
+                   const char *prefix,
+                   struct repository *repo UNUSED)
 {
        const char *dir;
        int strict = 0;
index e30ff45be1ce730633d84cfc9c5caf0dab187dd1..4a5c2649d6ff825d1cd4595453aa5e076f1eff7f 100644 (file)
@@ -210,7 +210,10 @@ static int show_config(const char *var, const char *value,
        return git_default_config(var, value, ctx, cb);
 }
 
-int cmd_var(int argc, const char **argv, const char *prefix UNUSED)
+int cmd_var(int argc,
+           const char **argv,
+           const char *prefix UNUSED,
+           struct repository *repo UNUSED)
 {
        const struct git_var *git_var;
        char *val;
index 0d2b9aea2aedca39b18d15bc7a8719669d63f1d3..c5859e5b2b45360b0e51a0ecef51d610ec4ed206 100644 (file)
@@ -51,7 +51,10 @@ static int verify_commit(const char *name, unsigned flags)
        return run_gpg_verify((struct commit *)obj, flags);
 }
 
-int cmd_verify_commit(int argc, const char **argv, const char *prefix)
+int cmd_verify_commit(int argc,
+                     const char **argv,
+                     const char *prefix,
+                     struct repository *repo UNUSED)
 {
        int i = 1, verbose = 0, had_error = 0;
        unsigned flags = 0;
index 011dddd2dc329292c363fbcfb10b71c218ffa034..7ad456649d2c5654a242f561dbc4245e1f31abde 100644 (file)
@@ -61,7 +61,10 @@ static const char * const verify_pack_usage[] = {
        NULL
 };
 
-int cmd_verify_pack(int argc, const char **argv, const char *prefix)
+int cmd_verify_pack(int argc,
+                   const char **argv,
+                   const char *prefix,
+                   struct repository *repo UNUSED)
 {
        int err = 0;
        unsigned int flags = 0;
index c731e2f87b4ee35e4910e3a8c11e18b8e68e58c1..a7bef52419134838386d0296bfa45b8a4becbf30 100644 (file)
@@ -19,7 +19,10 @@ static const char * const verify_tag_usage[] = {
                NULL
 };
 
-int cmd_verify_tag(int argc, const char **argv, const char *prefix)
+int cmd_verify_tag(int argc,
+                  const char **argv,
+                  const char *prefix,
+                  struct repository *repo UNUSED)
 {
        int i = 1, verbose = 0, had_error = 0;
        unsigned flags = 0;
index 41e7f6a3271b71e23b8b4814fcc98e7320782d79..3b47f9832fa39aafedcb1588d1cd8aaa3167a5f0 100644 (file)
@@ -1392,7 +1392,10 @@ static int repair(int ac, const char **av, const char *prefix)
        return rc;
 }
 
-int cmd_worktree(int ac, const char **av, const char *prefix)
+int cmd_worktree(int ac,
+                const char **av,
+                const char *prefix,
+                struct repository *repo UNUSED)
 {
        parse_opt_subcommand_fn *fn = NULL;
        struct option options[] = {
index 8c75b4609b5692d3c41836793d4cad878219a2ac..1b467d6ed231edc17decf6241246ba52d6ec057b 100644 (file)
@@ -19,7 +19,10 @@ static const char * const write_tree_usage[] = {
        NULL
 };
 
-int cmd_write_tree(int argc, const char **argv, const char *cmd_prefix)
+int cmd_write_tree(int argc,
+                  const char **argv,
+                  const char *cmd_prefix,
+                  struct repository *repo UNUSED)
 {
        int flags = 0, ret;
        const char *tree_prefix = NULL;
diff --git a/git.c b/git.c
index 9a618a2740f1953e21bc18a49cc8db1ffb5dd4db..2fbea24ec921e02cf71e63b27e3cf0e023eb8602 100644 (file)
--- a/git.c
+++ b/git.c
@@ -31,7 +31,7 @@
 
 struct cmd_struct {
        const char *cmd;
-       int (*fn)(int, const char **, const char *);
+       int (*fn)(int, const char **, const char *, struct repository *);
        unsigned int option;
 };
 
@@ -441,7 +441,7 @@ static int handle_alias(int *argcp, const char ***argv)
        return ret;
 }
 
-static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
+static int run_builtin(struct cmd_struct *p, int argc, const char **argv, struct repository *repo)
 {
        int status, help;
        struct stat st;
@@ -479,9 +479,9 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
        trace_argv_printf(argv, "trace: built-in: git");
        trace2_cmd_name(p->cmd);
 
-       validate_cache_entries(the_repository->index);
-       status = p->fn(argc, argv, prefix);
-       validate_cache_entries(the_repository->index);
+       validate_cache_entries(repo->index);
+       status = p->fn(argc, argv, prefix, (p->option & RUN_SETUP)? repo : NULL);
+       validate_cache_entries(repo->index);
 
        if (status)
                return status;
@@ -736,7 +736,7 @@ static void handle_builtin(int argc, const char **argv)
 
        builtin = get_builtin(cmd);
        if (builtin)
-               exit(run_builtin(builtin, argc, argv));
+               exit(run_builtin(builtin, argc, argv, the_repository));
        strvec_clear(&args);
 }
 
diff --git a/help.c b/help.c
index c03863f2265f7bbaba72fc26b377a677683ea58d..e7cdfab6432c81ce3bda80f0dc4bd7ed09914984 100644 (file)
--- a/help.c
+++ b/help.c
@@ -16,6 +16,7 @@
 #include "parse-options.h"
 #include "prompt.h"
 #include "fsmonitor-ipc.h"
+#include "repository.h"
 
 #ifndef NO_CURL
 #include "git-curl-compat.h" /* For LIBCURL_VERSION only */
@@ -775,7 +776,7 @@ void get_version_info(struct strbuf *buf, int show_build_options)
        }
 }
 
-int cmd_version(int argc, const char **argv, const char *prefix)
+int cmd_version(int argc, const char **argv, const char *prefix, struct repository *repository UNUSED)
 {
        struct strbuf buf = STRBUF_INIT;
        int build_options = 0;