git-commit -s: no extra space when sign-offs appear at the end already.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Jan 29, 2007 at 01:06 UTC
dbaa06a2b0f58b7bf1d337380eb61fa4064c1b15
1 file changed
+4
-1
git-commit.sh
+4
-1
@@ -442,8 +442,11 @@ fi | git-stripspace >"$GIT_DIR"/COMMIT_EDITMSG
442
443
case "$signoff" in
444
t)
445
+ need_blank_before_signoff=
446
+ tail -n 1 "$GIT_DIR"/COMMIT_EDITMSG |
447
+ grep 'Signed-off-by:' >/dev/null || need_blank_before_signoff=yes
448
{
446
- echo
449
+ test -z "$need_blank_before_signoff" || echo
450
git-var GIT_COMMITTER_IDENT | sed -e '
451
s/>.*/>/
452
s/^/Signed-off-by: /