summaryrefslogtreecommitdiff
path: root/ref-filter.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2023-07-10 21:12:07 (GMT)
committerJunio C Hamano <gitster@pobox.com>2023-07-10 21:48:55 (GMT)
commitb9f7daa6ef52ad8894b5f730eaee0599668d66d5 (patch)
treef7f0c6753626a3b2169780491c3cc870f20b9090 /ref-filter.h
parentbf1377a12b904a01692be9f0fd5746c7e71c8878 (diff)
downloadgit-b9f7daa6ef52ad8894b5f730eaee0599668d66d5.zip
git-b9f7daa6ef52ad8894b5f730eaee0599668d66d5.tar.gz
git-b9f7daa6ef52ad8894b5f730eaee0599668d66d5.tar.bz2
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 'ref-filter.h')
-rw-r--r--ref-filter.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/ref-filter.h b/ref-filter.h
index 430701c..a920f73 100644
--- a/ref-filter.h
+++ b/ref-filter.h
@@ -92,6 +92,9 @@ struct ref_format {
struct string_list bases;
};
+#define REF_FILTER_INIT { \
+ .points_at = OID_ARRAY_INIT, \
+}
#define REF_FORMAT_INIT { \
.use_color = -1, \
.bases = STRING_LIST_INIT_DUP, \