Skip to content

Commit 2d653c5

Browse files
peffgitster
authored andcommitted
ref-filter: drop broken-ref code entirely
Now that none of our callers passes the INCLUDE_BROKEN flag, we can drop it entirely, along with the code to plumb it through to the for_each_fullref_in() functions. Signed-off-by: Jeff King <[email protected]> Reviewed-by: Jonathan Tan <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1763334 commit 2d653c5

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

ref-filter.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2405,13 +2405,10 @@ int filter_refs(struct ref_array *array, struct ref_filter *filter, unsigned int
24052405
{
24062406
struct ref_filter_cbdata ref_cbdata;
24072407
int ret = 0;
2408-
unsigned int broken = 0;
24092408

24102409
ref_cbdata.array = array;
24112410
ref_cbdata.filter = filter;
24122411

2413-
if (type & FILTER_REFS_INCLUDE_BROKEN)
2414-
broken = 1;
24152412
filter->kind = type & FILTER_REFS_KIND_MASK;
24162413

24172414
init_contains_cache(&ref_cbdata.contains_cache);
@@ -2428,13 +2425,13 @@ int filter_refs(struct ref_array *array, struct ref_filter *filter, unsigned int
24282425
* of filter_ref_kind().
24292426
*/
24302427
if (filter->kind == FILTER_REFS_BRANCHES)
2431-
ret = for_each_fullref_in("refs/heads/", ref_filter_handler, &ref_cbdata, broken);
2428+
ret = for_each_fullref_in("refs/heads/", ref_filter_handler, &ref_cbdata, 0);
24322429
else if (filter->kind == FILTER_REFS_REMOTES)
2433-
ret = for_each_fullref_in("refs/remotes/", ref_filter_handler, &ref_cbdata, broken);
2430+
ret = for_each_fullref_in("refs/remotes/", ref_filter_handler, &ref_cbdata, 0);
24342431
else if (filter->kind == FILTER_REFS_TAGS)
2435-
ret = for_each_fullref_in("refs/tags/", ref_filter_handler, &ref_cbdata, broken);
2432+
ret = for_each_fullref_in("refs/tags/", ref_filter_handler, &ref_cbdata, 0);
24362433
else if (filter->kind & FILTER_REFS_ALL)
2437-
ret = for_each_fullref_in_pattern(filter, ref_filter_handler, &ref_cbdata, broken);
2434+
ret = for_each_fullref_in_pattern(filter, ref_filter_handler, &ref_cbdata, 0);
24382435
if (!ret && (filter->kind & FILTER_REFS_DETACHED_HEAD))
24392436
head_ref(ref_filter_handler, &ref_cbdata);
24402437
}

ref-filter.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#define QUOTE_PYTHON 4
1414
#define QUOTE_TCL 8
1515

16-
#define FILTER_REFS_INCLUDE_BROKEN 0x0001
1716
#define FILTER_REFS_TAGS 0x0002
1817
#define FILTER_REFS_BRANCHES 0x0004
1918
#define FILTER_REFS_REMOTES 0x0008

0 commit comments

Comments
 (0)