summaryrefslogtreecommitdiff
path: root/builtin-mailinfo.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-08-26 21:36:05 -0700
committerJunio C Hamano <gitster@pobox.com>2009-08-26 22:22:22 -0700
commit017678b4f47dc1b2a6691631373c46daf8f63206 (patch)
treecf2a657570db595a71a35f7820a80eb2ded84309 /builtin-mailinfo.c
parentf43c97f5720f48598e59629f7dc9892d082d8b0e (diff)
downloadgit-017678b4f47dc1b2a6691631373c46daf8f63206.tar.gz
am/mailinfo: Disable scissors processing by default
You can enable it by giving --scissors to "git am". Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-mailinfo.c')
-rw-r--r--builtin-mailinfo.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
index a6f6b123b4..1c14d381d2 100644
--- a/builtin-mailinfo.c
+++ b/builtin-mailinfo.c
@@ -25,6 +25,7 @@ static enum {
static struct strbuf charset = STRBUF_INIT;
static int patch_lines;
static struct strbuf **p_hdr_data, **s_hdr_data;
+static int use_scissors;
#define MAX_HDR_PARSED 10
#define MAX_BOUNDARIES 5
@@ -782,7 +783,7 @@ static int handle_commit_msg(struct strbuf *line)
if (metainfo_charset)
convert_to_utf8(line, charset.buf);
- if (is_scissors_line(line)) {
+ if (use_scissors && is_scissors_line(line)) {
int i;
rewind(cmitmsg);
ftruncate(fileno(cmitmsg), 0);
@@ -1014,6 +1015,10 @@ int cmd_mailinfo(int argc, const char **argv, const char *prefix)
metainfo_charset = NULL;
else if (!prefixcmp(argv[1], "--encoding="))
metainfo_charset = argv[1] + 11;
+ else if (!strcmp(argv[1], "--scissors"))
+ use_scissors = 1;
+ else if (!strcmp(argv[1], "--no-scissors"))
+ use_scissors = 0;
else
usage(mailinfo_usage);
argc--; argv++;