@@ -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;
@@ -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;
@@ -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);
@@ -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;
}
@@ -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);
-}
@@ -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 */
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