summaryrefslogtreecommitdiff
path: root/builtin-log.c
diff options
context:
space:
mode:
authorStephen Boyd <bebarino@gmail.com>2009-03-22 19:14:05 -0700
committerJunio C Hamano <gitster@pobox.com>2009-03-22 21:45:19 -0700
commit108dab2811701c20d6d6e8d9fe8af88e41d65d77 (patch)
tree7f421f58447ff79392778c433f061d7fcbb91f2a /builtin-log.c
parent6fa8e6278b210bfa56fcb54ed38d2b485350e7c6 (diff)
downloadgit-108dab2811701c20d6d6e8d9fe8af88e41d65d77.tar.gz
format-patch: --attach/inline uses filename instead of SHA1
Currently when format-patch is used with --attach or --inline the patch attachment has the SHA1 of the commit for its filename. This replaces the SHA1 with the filename used by format-patch when outputting to files. Fix tests relying on the SHA1 output and add a test showing how the --suffix option affects the attachment filename output. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-log.c')
-rw-r--r--builtin-log.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin-log.c b/builtin-log.c
index 4f438db4c1..3e3cbc11fd 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -607,7 +607,6 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,
int nr, struct commit **list, struct commit *head)
{
const char *committer;
- char *head_sha1;
const char *subject_start = NULL;
const char *body = "*** SUBJECT HERE ***\n\n*** BLURB HERE ***\n";
const char *msg;
@@ -624,7 +623,6 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,
die("Cover letter needs email format");
committer = git_committer_info(0);
- head_sha1 = sha1_to_hex(head->object.sha1);
if (!numbered_files) {
/*
@@ -639,7 +637,7 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,
"author %s\n"
"committer %s\n\n"
"cover letter\n",
- head_sha1, committer, committer);
+ sha1_to_hex(head->object.sha1), committer, committer);
}
if (!use_stdout && reopen_stdout(commit, rev))
@@ -651,7 +649,7 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,
free(commit);
}
- log_write_email_headers(rev, head_sha1, &subject_start, &extra_headers,
+ log_write_email_headers(rev, head, &subject_start, &extra_headers,
&need_8bit_cte);
msg = body;
@@ -1011,6 +1009,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
const char *msgid = clean_message_id(in_reply_to);
string_list_append(msgid, rev.ref_message_ids);
}
+ rev.numbered_files = numbered_files;
+ rev.patch_suffix = fmt_patch_suffix;
if (cover_letter) {
if (thread)
gen_message_id(&rev, "cover");