aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/bundle.c
diff options
context:
space:
mode:
authorKarthik Nayak <karthik.188@gmail.com>2024-11-25 15:55:30 +0100
committerJunio C Hamano <gitster@pobox.com>2024-11-26 10:36:08 +0900
commit6f33d8e255cb2ff738cd28eab22751efb7c2d6ce (patch)
tree5d2830f4bd30852d1ae082a0bccb26652ff7d689 /builtin/bundle.c
parent6ea2d9d271a56afa0e77cd45796ea0592aa9c2d4 (diff)
downloadgit-6f33d8e255cb2ff738cd28eab22751efb7c2d6ce.tar.gz
builtin: pass repository to sub commands
In 9b1cb5070f (builtin: add a repository parameter for builtin functions, 2024-09-13) the repository was passed down to all builtin commands. This allowed the repository to be passed down to lower layers without depending on the global `the_repository` variable. Continue this work by also passing down the repository parameter from the command to sub-commands. This will help pass down the repository to other subsystems and cleanup usage of global variables like 'the_repository' and 'the_hash_algo'. Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/bundle.c')
-rw-r--r--builtin/bundle.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/builtin/bundle.c b/builtin/bundle.c
index 127518c2a8..3f14754197 100644
--- a/builtin/bundle.c
+++ b/builtin/bundle.c
@@ -67,7 +67,8 @@ static int parse_options_cmd_bundle(int argc,
return argc;
}
-static int cmd_bundle_create(int argc, const char **argv, const char *prefix) {
+static int cmd_bundle_create(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED) {
struct strvec pack_opts = STRVEC_INIT;
int version = -1;
int ret;
@@ -123,7 +124,8 @@ static int open_bundle(const char *path, struct bundle_header *header,
return read_bundle_header(path, header);
}
-static int cmd_bundle_verify(int argc, const char **argv, const char *prefix) {
+static int cmd_bundle_verify(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED) {
struct bundle_header header = BUNDLE_HEADER_INIT;
int bundle_fd = -1;
int quiet = 0;
@@ -164,7 +166,8 @@ cleanup:
return ret;
}
-static int cmd_bundle_list_heads(int argc, const char **argv, const char *prefix) {
+static int cmd_bundle_list_heads(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED) {
struct bundle_header header = BUNDLE_HEADER_INIT;
int bundle_fd = -1;
int ret;
@@ -189,7 +192,8 @@ cleanup:
return ret;
}
-static int cmd_bundle_unbundle(int argc, const char **argv, const char *prefix) {
+static int cmd_bundle_unbundle(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED) {
struct bundle_header header = BUNDLE_HEADER_INIT;
int bundle_fd = -1;
int ret;
@@ -231,7 +235,7 @@ cleanup:
int cmd_bundle(int argc,
const char **argv,
const char *prefix,
- struct repository *repo UNUSED)
+ struct repository *repo)
{
parse_opt_subcommand_fn *fn = NULL;
struct option options[] = {
@@ -247,5 +251,5 @@ int cmd_bundle(int argc,
packet_trace_identity("bundle");
- return !!fn(argc, argv, prefix);
+ return !!fn(argc, argv, prefix, repo);
}