summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-10-31 21:55:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-11-02 00:18:39 (GMT)
commit4593fb84051d39f65cec81958e91056986e4682f (patch)
tree1578c05838433c52285292a762077317d86fee95 /commit.c
parent3e4bb087a18435b12eb82116e93af2887578e816 (diff)
downloadgit-4593fb84051d39f65cec81958e91056986e4682f.zip
git-4593fb84051d39f65cec81958e91056986e4682f.tar.gz
git-4593fb84051d39f65cec81958e91056986e4682f.tar.bz2
format-patch -s: add MIME encoding header if signer's name requires so
When the body of the commit log message contains a non-ASCII character, format-patch correctly emitted the encoding header to mark the resulting message as such. However, if the original message was fully ASCII, the command line switch "-s" was given to add a new sign-off, and the signer's name was not ASCII only, the resulting message would have contained non-ASCII character but was not marked as such. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/commit.c b/commit.c
index ac24266..8262f6a 100644
--- a/commit.c
+++ b/commit.c
@@ -479,7 +479,7 @@ static int get_one_line(const char *msg)
}
/* High bit set, or ISO-2022-INT */
-static int non_ascii(int ch)
+int non_ascii(int ch)
{
ch = (ch & 0xff);
return ((ch & 0x80) || (ch == 0x1b));
@@ -1046,12 +1046,11 @@ static void pp_remainder(enum cmit_fmt fmt,
void pretty_print_commit(enum cmit_fmt fmt, const struct commit *commit,
struct strbuf *sb, int abbrev,
const char *subject, const char *after_subject,
- enum date_mode dmode)
+ enum date_mode dmode, int plain_non_ascii)
{
unsigned long beginning_of_body;
int indent = 4;
const char *msg = commit->buffer;
- int plain_non_ascii = 0;
char *reencoded;
const char *encoding;