ref-filter: remove unnecessary else clause
In 'ref-filter.c', there is an 'else' clause within `do_filter_refs()`. This is unnecessary since the 'if' clause calls `die()`, which would exit the program. So let's remove the unnecessary 'else' clause. This improves readability since the indentation is also reduced and flow is simpler. Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
2b4648b919
commit
526530a16a
@@ -3199,7 +3199,7 @@ static int do_filter_refs(struct ref_filter *filter, unsigned int type, each_ref
|
|||||||
/* Simple per-ref filtering */
|
/* Simple per-ref filtering */
|
||||||
if (!filter->kind)
|
if (!filter->kind)
|
||||||
die("filter_refs: invalid type");
|
die("filter_refs: invalid type");
|
||||||
else {
|
|
||||||
/*
|
/*
|
||||||
* For common cases where we need only branches or remotes or tags,
|
* For common cases where we need only branches or remotes or tags,
|
||||||
* we only iterate through those refs. If a mix of refs is needed,
|
* we only iterate through those refs. If a mix of refs is needed,
|
||||||
@@ -3229,7 +3229,7 @@ static int do_filter_refs(struct ref_filter *filter, unsigned int type, each_ref
|
|||||||
(filter->kind & FILTER_REFS_DETACHED_HEAD))
|
(filter->kind & FILTER_REFS_DETACHED_HEAD))
|
||||||
refs_head_ref(get_main_ref_store(the_repository), fn,
|
refs_head_ref(get_main_ref_store(the_repository), fn,
|
||||||
cb_data);
|
cb_data);
|
||||||
}
|
|
||||||
|
|
||||||
clear_contains_cache(&filter->internal.contains_cache);
|
clear_contains_cache(&filter->internal.contains_cache);
|
||||||
clear_contains_cache(&filter->internal.no_contains_cache);
|
clear_contains_cache(&filter->internal.no_contains_cache);
|
||||||
|
|||||||
Reference in New Issue
Block a user