diff mbox series

[v2,3/3] ref-filter: remove ref_format_clear()

Message ID bd53e91c-f33d-43cd-b650-2ed93e0b963b@web.de (mailing list archive)
State New
Headers show
Series ref-filter: share bases and is_base_tips between formatting and sorting | expand

Commit Message

René Scharfe Jan. 18, 2025, 5:11 p.m. UTC
Now that ref_format_clear() no longer releases any memory we don't need
it anymore.  Remove it and its counterpart, ref_format_init().

Signed-off-by: René Scharfe <l.s.r@web.de>
---
 builtin/branch.c       |  1 -
 builtin/for-each-ref.c |  1 -
 builtin/tag.c          |  1 -
 builtin/verify-tag.c   |  1 -
 ref-filter.c           | 11 -----------
 ref-filter.h           |  3 ---
 6 files changed, 18 deletions(-)

--
2.48.1
diff mbox series

Patch

diff --git a/builtin/branch.c b/builtin/branch.c
index fbb9536282..9a29de5bf1 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -884,7 +884,6 @@  int cmd_branch(int argc,
 		string_list_clear(&output, 0);
 		ref_sorting_release(sorting);
 		ref_filter_clear(&filter);
-		ref_format_clear(&format);

 		ret = 0;
 		goto out;
diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c
index 715745a262..8085ebd8fe 100644
--- a/builtin/for-each-ref.c
+++ b/builtin/for-each-ref.c
@@ -108,7 +108,6 @@  int cmd_for_each_ref(int argc,
 	filter_and_format_refs(&filter, flags, sorting, &format);

 	ref_filter_clear(&filter);
-	ref_format_clear(&format);
 	ref_sorting_release(sorting);
 	strvec_clear(&vec);
 	return 0;
diff --git a/builtin/tag.c b/builtin/tag.c
index c4bd145831..e8a344b926 100644
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -698,7 +698,6 @@  int cmd_tag(int argc,
 cleanup:
 	ref_sorting_release(sorting);
 	ref_filter_clear(&filter);
-	ref_format_clear(&format);
 	strbuf_release(&buf);
 	strbuf_release(&ref);
 	strbuf_release(&reflog_msg);
diff --git a/builtin/verify-tag.c b/builtin/verify-tag.c
index a7f20618ff..f6b97048a5 100644
--- a/builtin/verify-tag.c
+++ b/builtin/verify-tag.c
@@ -69,6 +69,5 @@  int cmd_verify_tag(int argc,
 		if (format.format)
 			pretty_print_ref(name, &oid, &format);
 	}
-	ref_format_clear(&format);
 	return had_error;
 }
diff --git a/ref-filter.c b/ref-filter.c
index 9a4b2d4cea..6da8d4c03b 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -3660,14 +3660,3 @@  void ref_filter_clear(struct ref_filter *filter)
 	free_commit_list(filter->unreachable_from);
 	ref_filter_init(filter);
 }
-
-void ref_format_init(struct ref_format *format)
-{
-	struct ref_format blank = REF_FORMAT_INIT;
-	memcpy(format, &blank, sizeof(blank));
-}
-
-void ref_format_clear(struct ref_format *format)
-{
-	ref_format_init(format);
-}
diff --git a/ref-filter.h b/ref-filter.h
index 0ba94df651..013d4cfa64 100644
--- a/ref-filter.h
+++ b/ref-filter.h
@@ -211,7 +211,4 @@  void filter_is_base(struct repository *r,
 void ref_filter_init(struct ref_filter *filter);
 void ref_filter_clear(struct ref_filter *filter);

-void ref_format_init(struct ref_format *format);
-void ref_format_clear(struct ref_format *format);
-
 #endif /*  REF_FILTER_H  */