Skip to content

Commit 0131780

Browse files
committed
bundle-verify: add --quiet
Add --quiet to git-bundle verify as proposed per [1] [1] <[email protected]> Reference: https://www.mail-archive.com/[email protected]/msg182844.html Signed-off-by: Robin H. Johnson <[email protected]>
1 parent 5678de0 commit 0131780

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Documentation/git-bundle.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SYNOPSIS
1010
--------
1111
[verse]
1212
'git bundle' create [-q | --quiet | --progress | --all-progress] [--all-progress-implied] <file> <git-rev-list-args>
13-
'git bundle' verify <file>
13+
'git bundle' verify [-q | --quiet] <file>
1414
'git bundle' list-heads <file> [<refname>...]
1515
'git bundle' unbundle <file> [<refname>...]
1616

builtin/bundle.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
static const char * const builtin_bundle_usage[] = {
1515
N_("git bundle create [<options>] <file> <git-rev-list args>"),
16-
N_("git bundle verify <file>"),
16+
N_("git bundle verify [<options>] <file>"),
1717
N_("git bundle list-heads <file> [<refname>...]"),
1818
N_("git bundle unbundle <file> [<refname>...]"),
1919
NULL
@@ -25,7 +25,7 @@ static const char * const builtin_bundle_create_usage[] = {
2525
};
2626

2727
static const char * const builtin_bundle_verify_usage[] = {
28-
N_("git bundle verify <file>"),
28+
N_("git bundle verify [<options>] <file>"),
2929
NULL
3030
};
3131

@@ -97,8 +97,11 @@ static int cmd_bundle_create(int argc, const char **argv, const char *prefix) {
9797
static int cmd_bundle_verify(int argc, const char **argv, const char *prefix) {
9898
struct bundle_header header;
9999
int bundle_fd = -1;
100+
int quiet = 0;
100101

101102
struct option options[] = {
103+
OPT_BOOL('q', "quiet", &quiet,
104+
N_("do not show bundle details")),
102105
OPT_END()
103106
};
104107
const char* bundle_file;
@@ -111,7 +114,7 @@ static int cmd_bundle_verify(int argc, const char **argv, const char *prefix) {
111114
if ((bundle_fd = read_bundle_header(bundle_file, &header)) < 0)
112115
return 1;
113116
close(bundle_fd);
114-
if (verify_bundle(the_repository, &header, 1))
117+
if (verify_bundle(the_repository, &header, !quiet))
115118
return 1;
116119
fprintf(stderr, _("%s is okay\n"), bundle_file);
117120
return 0;

0 commit comments

Comments
 (0)