Skip to content

Commit 810f7a1

Browse files
KarthikNayakgitster
authored andcommitted
ref-filter: rename 'FILTER_REFS_ALL' to 'FILTER_REFS_REGULAR'
The flag 'FILTER_REFS_ALL' is a bit ambiguous, where ALL doesn't specify if it means to contain refs from all worktrees or whether all types of refs (regular, HEAD & pseudorefs) or all of the above. Since here it is actually referring to all refs with the "refs/" prefix, let's rename it to 'FILTER_REFS_REGULAR' to indicate that this is specifically for regular refs. Signed-off-by: Karthik Nayak <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d0f00c1 commit 810f7a1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

builtin/for-each-ref.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ int cmd_for_each_ref(int argc, const char **argv, const char *prefix)
9797
}
9898

9999
filter.match_as_path = 1;
100-
filter_and_format_refs(&filter, FILTER_REFS_ALL, sorting, &format);
100+
filter_and_format_refs(&filter, FILTER_REFS_REGULAR, sorting, &format);
101101

102102
ref_filter_clear(&filter);
103103
ref_sorting_release(sorting);

ref-filter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3041,7 +3041,7 @@ static int do_filter_refs(struct ref_filter *filter, unsigned int type, each_ref
30413041
ret = for_each_fullref_in("refs/remotes/", fn, cb_data);
30423042
else if (filter->kind == FILTER_REFS_TAGS)
30433043
ret = for_each_fullref_in("refs/tags/", fn, cb_data);
3044-
else if (filter->kind & FILTER_REFS_ALL)
3044+
else if (filter->kind & FILTER_REFS_REGULAR)
30453045
ret = for_each_fullref_in_pattern(filter, fn, cb_data);
30463046
if (!ret && (filter->kind & FILTER_REFS_DETACHED_HEAD))
30473047
head_ref(fn, cb_data);

ref-filter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
#define FILTER_REFS_BRANCHES 0x0004
2020
#define FILTER_REFS_REMOTES 0x0008
2121
#define FILTER_REFS_OTHERS 0x0010
22-
#define FILTER_REFS_ALL (FILTER_REFS_TAGS | FILTER_REFS_BRANCHES | \
22+
#define FILTER_REFS_REGULAR (FILTER_REFS_TAGS | FILTER_REFS_BRANCHES | \
2323
FILTER_REFS_REMOTES | FILTER_REFS_OTHERS)
2424
#define FILTER_REFS_DETACHED_HEAD 0x0020
25-
#define FILTER_REFS_KIND_MASK (FILTER_REFS_ALL | FILTER_REFS_DETACHED_HEAD)
25+
#define FILTER_REFS_KIND_MASK (FILTER_REFS_REGULAR | FILTER_REFS_DETACHED_HEAD)
2626

2727
struct atom_value;
2828
struct ref_sorting;

0 commit comments

Comments
 (0)