diff options
| author | Jeff King <peff@peff.net> | 2023-07-10 17:12:07 -0400 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-07-10 14:48:55 -0700 |
| commit | b9f7daa6ef52ad8894b5f730eaee0599668d66d5 (patch) | |
| tree | f7f0c6753626a3b2169780491c3cc870f20b9090 /builtin/branch.c | |
| parent | refs.c: rename `ref_filter` (diff) | |
| download | git-b9f7daa6ef52ad8894b5f730eaee0599668d66d5.tar.gz git-b9f7daa6ef52ad8894b5f730eaee0599668d66d5.zip | |
ref-filter.h: provide `REF_FILTER_INIT`
Provide a sane initialization value for `struct ref_filter`, which in a
subsequent patch will be used to initialize a new field.
In the meantime, ensure that the `ref_filter` struct used in the
test-helper's `cmd__reach()` is zero-initialized. The lack of
initialization is OK, since `commit_contains()` only looks at the single
`with_commit_tag_algo` field that *is* initialized directly above.
So this does not fix a bug, but rather prevents one from biting us in
the future.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/branch.c')
| -rw-r--r-- | builtin/branch.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/branch.c b/builtin/branch.c index e6c2655af6..7891dec361 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -707,7 +707,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix) int reflog = 0, quiet = 0, icase = 0, force = 0, recurse_submodules_explicit = 0; enum branch_track track; - struct ref_filter filter; + struct ref_filter filter = REF_FILTER_INIT; static struct ref_sorting *sorting; struct string_list sorting_options = STRING_LIST_INIT_DUP; struct ref_format format = REF_FORMAT_INIT; @@ -765,7 +765,6 @@ int cmd_branch(int argc, const char **argv, const char *prefix) setup_ref_filter_porcelain_msg(); - memset(&filter, 0, sizeof(filter)); filter.kind = FILTER_REFS_BRANCHES; filter.abbrev = -1; |
