From a21c2f94fb6e74ebddb5c78cf6b5f68983646530 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Mon, 21 May 2012 19:10:32 -0400 Subject: format-patch: refactor get_patch_filename The get_patch_filename function expects a commit argument and uses it to get the sanitized subject line when making a patch filename. However, we also want to use this same function for the cover letter, which does not have a commit object. The current solution is to create a fake commit with the subject "cover letter". Instead, let's make the get_patch_filename interface more flexibile, and allow passing a direct subject. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- log-tree.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'log-tree.h') diff --git a/log-tree.h b/log-tree.h index 5c4cf7cac..f5ac238bb 100644 --- a/log-tree.h +++ b/log-tree.h @@ -21,7 +21,7 @@ void log_write_email_headers(struct rev_info *opt, struct commit *commit, void load_ref_decorations(int flags); #define FORMAT_PATCH_NAME_MAX 64 -void get_patch_filename(struct commit *commit, int nr, const char *suffix, - struct strbuf *buf); +void get_patch_filename(struct commit *commit, const char *subject, int nr, + const char *suffix, struct strbuf *buf); #endif -- cgit v1.2.1