summaryrefslogtreecommitdiff
path: root/bundle.c
diff options
context:
space:
mode:
authorDerrick Stolee <derrickstolee@github.com>2022-10-12 12:52:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-10-12 16:13:25 (GMT)
commit89bd7fedf947484da08e2722d663fdac23a431be (patch)
tree3b293a3fd460a91bc59ae0511338348f3a5c2aec /bundle.c
parentc23f592117bac30765ca22545386c3e9304da803 (diff)
downloadgit-89bd7fedf947484da08e2722d663fdac23a431be.zip
git-89bd7fedf947484da08e2722d663fdac23a431be.tar.gz
git-89bd7fedf947484da08e2722d663fdac23a431be.tar.bz2
bundle: add flags to verify_bundle()
The verify_bundle() method has a 'verbose' option, but we will want to extend this method to have more granular control over its output. First, replace this 'verbose' option with a new 'flags' option with a single possible value: VERIFY_BUNDLE_VERBOSE. Signed-off-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'bundle.c')
-rw-r--r--bundle.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/bundle.c b/bundle.c
index c277f3b..1f6a7f7 100644
--- a/bundle.c
+++ b/bundle.c
@@ -189,7 +189,7 @@ static int list_refs(struct string_list *r, int argc, const char **argv)
int verify_bundle(struct repository *r,
struct bundle_header *header,
- int verbose)
+ enum verify_bundle_flags flags)
{
/*
* Do fast check, then if any prereqs are missing then go line by line
@@ -248,7 +248,7 @@ int verify_bundle(struct repository *r,
error("%s %s", oid_to_hex(oid), name);
}
- if (verbose) {
+ if (flags & VERIFY_BUNDLE_VERBOSE) {
struct string_list *r;
r = &header->references;
@@ -617,7 +617,8 @@ err:
}
int unbundle(struct repository *r, struct bundle_header *header,
- int bundle_fd, struct strvec *extra_index_pack_args)
+ int bundle_fd, struct strvec *extra_index_pack_args,
+ enum verify_bundle_flags flags)
{
struct child_process ip = CHILD_PROCESS_INIT;
strvec_pushl(&ip.args, "index-pack", "--fix-thin", "--stdin", NULL);
@@ -631,7 +632,7 @@ int unbundle(struct repository *r, struct bundle_header *header,
strvec_clear(extra_index_pack_args);
}
- if (verify_bundle(r, header, 0))
+ if (verify_bundle(r, header, flags))
return -1;
ip.in = bundle_fd;
ip.no_stdout = 1;