Skip to content

Commit 2d79aa9

Browse files
shejialuogitster
authored andcommitted
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 <[email protected]> Mentored-by: Karthik Nayak <[email protected]> Signed-off-by: shejialuo <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 39bf06a commit 2d79aa9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

fsck.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ void fsck_set_msg_types(struct fsck_options *options, const char *values)
205205
if (!strcmp(buf, "skiplist")) {
206206
if (equal == len)
207207
die("skiplist requires a path");
208-
oidset_parse_file(&options->skiplist, buf + equal + 1,
208+
oidset_parse_file(&options->skip_oids, buf + equal + 1,
209209
the_repository->hash_algo);
210210
buf += len + 1;
211211
continue;
@@ -223,7 +223,7 @@ void fsck_set_msg_types(struct fsck_options *options, const char *values)
223223
static int object_on_skiplist(struct fsck_options *opts,
224224
const struct object_id *oid)
225225
{
226-
return opts && oid && oidset_contains(&opts->skiplist, oid);
226+
return opts && oid && oidset_contains(&opts->skip_oids, oid);
227227
}
228228

229229
__attribute__((format (printf, 5, 6)))

fsck.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ struct fsck_options {
136136
fsck_error error_func;
137137
unsigned strict:1;
138138
enum fsck_msg_type *msg_type;
139-
struct oidset skiplist;
139+
struct oidset skip_oids;
140140
struct oidset gitmodules_found;
141141
struct oidset gitmodules_done;
142142
struct oidset gitattributes_found;
@@ -145,7 +145,7 @@ struct fsck_options {
145145
};
146146

147147
#define FSCK_OPTIONS_DEFAULT { \
148-
.skiplist = OIDSET_INIT, \
148+
.skip_oids = OIDSET_INIT, \
149149
.gitmodules_found = OIDSET_INIT, \
150150
.gitmodules_done = OIDSET_INIT, \
151151
.gitattributes_found = OIDSET_INIT, \

0 commit comments

Comments
 (0)