From b12909b329bc716317f37465c6f8652394c857c4 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Thu, 25 Sep 2008 18:55:28 +0200 Subject: [PATCH] tg mail: Fix $header string construction Prevents e.g. misinterpreting From: line at the body start. --- tg-mail.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tg-mail.sh b/tg-mail.sh index 24e5f67..fb686e9 100644 --- a/tg-mail.sh +++ b/tg-mail.sh @@ -29,10 +29,9 @@ base_rev="$(git rev-parse --short --verify "refs/top-bases/$name" 2>/dev/null)" patchfile="$(mktemp -t tg-mail.XXXXXX)" -$tg patch $name >"$patchfile" +$tg patch "$name" >"$patchfile" -hlines=$(grep -n -m 1 '^---' "$patchfile" | sed 's/:---//') -header=$(head -n $(($hlines - 1)) "$patchfile") +header="$(sed -e '/^$/,$d' "$patchfile")" -- 2.11.4.GIT