chiark / gitweb /
tg mail: Fix $header string construction
[topgit.git] / tg-mail.sh
index 24e5f67b2742b8edf6fd6213f58d6546a27e013c..fb686e945a457e08ed00e16a78f40792a2a99443 100644 (file)
@@ -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")"