fsck: rename "skiplist" to "skip_oids"

The "skiplist" field in "fsck_options" is related to objects. Because we are going to introduce ref consistency check, the "skiplist" name is too general which will make the caller think "skiplist" is related to both the refs and objects. It may seem that for both refs and objects, we should provide a general "skiplist" here. However, the type for "skiplist" is `struct oidset` which is totally unsuitable for refs. To avoid above ambiguity, rename "skiplist" to "skip_oids". Mentored-by: Patrick Steinhardt <ps@pks.im> Mentored-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: shejialuo <shejialuo@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

shejialuo committed Aug 8, 2024 at 19:24 UTC 2d79aa9095577bdc2049cfa938d18d3ebed5349f
2 files changed +4 -4
fsck.c
+2 -2
@@ -205,7 +205,7 @@ void fsck_set_msg_types(struct fsck_options *options, const char *values)
205 if (!strcmp(buf, "skiplist")) {
206 if (equal == len)
207 die("skiplist requires a path");
208 - oidset_parse_file(&options->skiplist, buf + equal + 1,
208 + oidset_parse_file(&options->skip_oids, buf + equal + 1,
209 the_repository->hash_algo);
210 buf += len + 1;
211 continue;
@@ -223,7 +223,7 @@ void fsck_set_msg_types(struct fsck_options *options, const char *values)
223 static int object_on_skiplist(struct fsck_options *opts,
224 const struct object_id *oid)
225 {
226 - return opts && oid && oidset_contains(&opts->skiplist, oid);
226 + return opts && oid && oidset_contains(&opts->skip_oids, oid);
227 }
228
229 __attribute__((format (printf, 5, 6)))
fsck.h
+2 -2
@@ -136,7 +136,7 @@ struct fsck_options {
136 fsck_error error_func;
137 unsigned strict:1;
138 enum fsck_msg_type *msg_type;
139 - struct oidset skiplist;
139 + struct oidset skip_oids;
140 struct oidset gitmodules_found;
141 struct oidset gitmodules_done;
142 struct oidset gitattributes_found;
@@ -145,7 +145,7 @@ struct fsck_options {
145 };
146
147 #define FSCK_OPTIONS_DEFAULT { \
148 - .skiplist = OIDSET_INIT, \
148 + .skip_oids = OIDSET_INIT, \
149 .gitmodules_found = OIDSET_INIT, \
150 .gitmodules_done = OIDSET_INIT, \
151 .gitattributes_found = OIDSET_INIT, \