]> git.ipfire.org Git - thirdparty/git.git/commitdiff
ref-filter: rename 'FILTER_REFS_ALL' to 'FILTER_REFS_REGULAR'
authorKarthik Nayak <karthik.188@gmail.com>
Fri, 23 Feb 2024 10:01:11 +0000 (11:01 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 23 Feb 2024 18:36:27 +0000 (10:36 -0800)
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 <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/for-each-ref.c
ref-filter.c
ref-filter.h

index 3885a9c28e149e5e4133bbf25aa557c38bd4193b..23d352e371df501bbe4932add2f4d2c9cefcfd20 100644 (file)
@@ -97,7 +97,7 @@ int cmd_for_each_ref(int argc, const char **argv, const char *prefix)
        }
 
        filter.match_as_path = 1;
-       filter_and_format_refs(&filter, FILTER_REFS_ALL, sorting, &format);
+       filter_and_format_refs(&filter, FILTER_REFS_REGULAR, sorting, &format);
 
        ref_filter_clear(&filter);
        ref_sorting_release(sorting);
index 35b989e1dfe59e9d274afead3d397f97ed624b26..1af39a86f875c4a60d88d16520497b6b4c8cb289 100644 (file)
@@ -3041,7 +3041,7 @@ static int do_filter_refs(struct ref_filter *filter, unsigned int type, each_ref
                        ret = for_each_fullref_in("refs/remotes/", fn, cb_data);
                else if (filter->kind == FILTER_REFS_TAGS)
                        ret = for_each_fullref_in("refs/tags/", fn, cb_data);
-               else if (filter->kind & FILTER_REFS_ALL)
+               else if (filter->kind & FILTER_REFS_REGULAR)
                        ret = for_each_fullref_in_pattern(filter, fn, cb_data);
                if (!ret && (filter->kind & FILTER_REFS_DETACHED_HEAD))
                        head_ref(fn, cb_data);
index 07cd6f6da3da7e3950dc77538baf0f71950630e1..5416936800ececb48da2fdbfa27dff6a6c96f5c1 100644 (file)
 #define FILTER_REFS_BRANCHES       0x0004
 #define FILTER_REFS_REMOTES        0x0008
 #define FILTER_REFS_OTHERS         0x0010
-#define FILTER_REFS_ALL            (FILTER_REFS_TAGS | FILTER_REFS_BRANCHES | \
+#define FILTER_REFS_REGULAR        (FILTER_REFS_TAGS | FILTER_REFS_BRANCHES | \
                                    FILTER_REFS_REMOTES | FILTER_REFS_OTHERS)
 #define FILTER_REFS_DETACHED_HEAD  0x0020
-#define FILTER_REFS_KIND_MASK      (FILTER_REFS_ALL | FILTER_REFS_DETACHED_HEAD)
+#define FILTER_REFS_KIND_MASK      (FILTER_REFS_REGULAR | FILTER_REFS_DETACHED_HEAD)
 
 struct atom_value;
 struct ref_sorting;