Merge branch 'kn/pass-repo-to-builtin-sub-sub-commands'

Built-in Git subcommands are supplied the repository object to work
with; they learned to do the same when they invoke sub-subcommands.

* kn/pass-repo-to-builtin-sub-sub-commands:
  builtin: pass repository to sub commands
This commit is contained in:
Junio C Hamano
2024-12-04 10:14:47 +09:00
17 changed files with 239 additions and 135 deletions

View File

@@ -13,7 +13,8 @@
#define REFS_VERIFY_USAGE \
N_("git refs verify [--strict] [--verbose]")
static int cmd_refs_migrate(int argc, const char **argv, const char *prefix)
static int cmd_refs_migrate(int argc, const char **argv, const char *prefix,
struct repository *repo UNUSED)
{
const char * const migrate_usage[] = {
REFS_MIGRATE_USAGE,
@@ -64,7 +65,8 @@ out:
return err;
}
static int cmd_refs_verify(int argc, const char **argv, const char *prefix)
static int cmd_refs_verify(int argc, const char **argv, const char *prefix,
struct repository *repo UNUSED)
{
struct fsck_options fsck_refs_options = FSCK_REFS_OPTIONS_DEFAULT;
struct worktree **worktrees;
@@ -99,7 +101,7 @@ static int cmd_refs_verify(int argc, const char **argv, const char *prefix)
int cmd_refs(int argc,
const char **argv,
const char *prefix,
struct repository *repo UNUSED)
struct repository *repo)
{
const char * const refs_usage[] = {
REFS_MIGRATE_USAGE,
@@ -114,5 +116,5 @@ int cmd_refs(int argc,
};
argc = parse_options(argc, argv, prefix, opts, refs_usage, 0);
return fn(argc, argv, prefix);
return fn(argc, argv, prefix, repo);
}