summaryrefslogtreecommitdiff
path: root/builtin/mailinfo.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-10-14 16:13:51 -0700
committerJunio C Hamano <gitster@pobox.com>2015-10-21 15:39:01 -0700
commit43550efa714c0285f0173ff0cebf231956659d62 (patch)
treed8c983df6e2b462aedbface3a55e7534e4941728 /builtin/mailinfo.c
parent13c6df2642343ec3d49e17082f38f191f175c742 (diff)
downloadgit-43550efa714c0285f0173ff0cebf231956659d62.tar.gz
mailinfo: move patch_lines to struct mailinfo
This one is trivial thanks to previous steps that started passing the structure throughout the input codepaths. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/mailinfo.c')
-rw-r--r--builtin/mailinfo.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c
index 517d6361ea..a104c5cbeb 100644
--- a/builtin/mailinfo.c
+++ b/builtin/mailinfo.c
@@ -20,6 +20,7 @@ struct mailinfo {
int keep_subject;
int keep_non_patch_brackets_in_subject;
+ int patch_lines;
int filter_stage; /* still reading log or are we copying patch? */
int header_stage; /* still checking in-body headers? */
};
@@ -30,7 +31,6 @@ static enum {
} transfer_encoding;
static struct strbuf charset = STRBUF_INIT;
-static int patch_lines;
static struct strbuf **p_hdr_data, **s_hdr_data;
static int use_scissors;
static int add_message_id;
@@ -707,10 +707,10 @@ static int handle_commit_msg(struct mailinfo *mi, struct strbuf *line)
return 0;
}
-static void handle_patch(const struct strbuf *line)
+static void handle_patch(struct mailinfo *mi, const struct strbuf *line)
{
fwrite(line->buf, 1, line->len, patchfile);
- patch_lines++;
+ mi->patch_lines++;
}
static void handle_filter(struct mailinfo *mi, struct strbuf *line)
@@ -721,7 +721,7 @@ static void handle_filter(struct mailinfo *mi, struct strbuf *line)
break;
mi->filter_stage++;
case 1:
- handle_patch(line);
+ handle_patch(mi, line);
break;
}
}
@@ -941,7 +941,7 @@ static void handle_info(struct mailinfo *mi)
for (i = 0; header[i]; i++) {
/* only print inbody headers if we output a patch file */
- if (patch_lines && s_hdr_data[i])
+ if (mi->patch_lines && s_hdr_data[i])
hdr = s_hdr_data[i];
else if (p_hdr_data[i])
hdr = p_hdr_data[i];