]> git.ipfire.org Git - thirdparty/git.git/commitdiff
fsck: rename "skiplist" to "skip_oids"
authorshejialuo <shejialuo@gmail.com>
Thu, 8 Aug 2024 11:24:13 +0000 (19:24 +0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 8 Aug 2024 16:36:52 +0000 (09:36 -0700)
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>
fsck.c
fsck.h

diff --git a/fsck.c b/fsck.c
index eea71454701c6dd5f48c60e2b6d9cd25388971c1..3f324414924d087ef78ce9bc3d697c29a46641cf 100644 (file)
--- a/fsck.c
+++ b/fsck.c
@@ -205,7 +205,7 @@ void fsck_set_msg_types(struct fsck_options *options, const char *values)
                if (!strcmp(buf, "skiplist")) {
                        if (equal == len)
                                die("skiplist requires a path");
-                       oidset_parse_file(&options->skiplist, buf + equal + 1,
+                       oidset_parse_file(&options->skip_oids, buf + equal + 1,
                                          the_repository->hash_algo);
                        buf += len + 1;
                        continue;
@@ -223,7 +223,7 @@ void fsck_set_msg_types(struct fsck_options *options, const char *values)
 static int object_on_skiplist(struct fsck_options *opts,
                              const struct object_id *oid)
 {
-       return opts && oid && oidset_contains(&opts->skiplist, oid);
+       return opts && oid && oidset_contains(&opts->skip_oids, oid);
 }
 
 __attribute__((format (printf, 5, 6)))
diff --git a/fsck.h b/fsck.h
index 6085a384f624f3da8278115a68319696cf039247..bcfb2e34cd6d1dbb3f777a5873f1a25dd0bd00f4 100644 (file)
--- a/fsck.h
+++ b/fsck.h
@@ -136,7 +136,7 @@ struct fsck_options {
        fsck_error error_func;
        unsigned strict:1;
        enum fsck_msg_type *msg_type;
-       struct oidset skiplist;
+       struct oidset skip_oids;
        struct oidset gitmodules_found;
        struct oidset gitmodules_done;
        struct oidset gitattributes_found;
@@ -145,7 +145,7 @@ struct fsck_options {
 };
 
 #define FSCK_OPTIONS_DEFAULT { \
-       .skiplist = OIDSET_INIT, \
+       .skip_oids = OIDSET_INIT, \
        .gitmodules_found = OIDSET_INIT, \
        .gitmodules_done = OIDSET_INIT, \
        .gitattributes_found = OIDSET_INIT, \