Commits

Junio C Hamano  committed dbaa06a

git-commit -s: no extra space when sign-offs appear at the end already.

Signed-off-by: Junio C Hamano <junkio@cox.net>

  • Participants
  • Parent commits def2747

Comments (0)

Files changed (1)

File git-commit.sh

 
 case "$signoff" in
 t)
+	need_blank_before_signoff=
+	tail -n 1 "$GIT_DIR"/COMMIT_EDITMSG |
+	grep 'Signed-off-by:' >/dev/null || need_blank_before_signoff=yes
 	{
-		echo
+		test -z "$need_blank_before_signoff" || echo
 		git-var GIT_COMMITTER_IDENT | sed -e '
 			s/>.*/>/
 			s/^/Signed-off-by: /