From 5e8e7ed191aaf72811334b4ba656405932719766 Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Thu, 05 Jan 2012 17:08:22 -0500 Subject: [PATCH] Fixed line spacing on pushes with multiple branches --- groovy/sendmail.groovy | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/groovy/sendmail.groovy b/groovy/sendmail.groovy index 9616909..0b60dfa 100644 --- a/groovy/sendmail.groovy +++ b/groovy/sendmail.groovy @@ -134,22 +134,22 @@ commitCount += commits.size() if (commits.size() > 0) { // new branch - changes += "$branchBreak new branch $ref created ($commits.size commits)\n$branchBreak" + changes += "\n$branchBreak new branch $ref created ($commits.size commits)\n$branchBreak" changes += commits.collect(table).join(commitBreak) changes += '\n' } else if (ref.command.refName.startsWith('refs/tags/')) { // new tag - changes += "$branchBreak new tag $ref created\n$branchBreak" + changes += "\n$branchBreak new tag $ref created\n$branchBreak" } else if (ref.command.refName.startsWith('refs/heads/')) { // new branch - changes += "$branchBreak new $ref branch created\n$branchBreak" + changes += "\n$branchBreak new $ref branch created\n$branchBreak" } break case ReceiveCommand.Type.UPDATE: def commits = JGitUtils.getRevLog(r, command.oldId.name, command.newId.name).reverse() commitCount += commits.size() // fast-forward branch commits table - changes += "$branchBreak $ref branch updated ($commits.size commits)\n$branchBreak" + changes += "\n$branchBreak $ref branch updated ($commits.size commits)\n$branchBreak" changes += commits.collect(table).join(commitBreak) changes += '\n' break @@ -157,13 +157,13 @@ def commits = JGitUtils.getRevLog(r, command.oldId.name, command.newId.name).reverse() commitCount += commits.size() // non-fast-forward branch commits table - changes += "$branchBreak $ref branch updated [NON fast-forward] ($commits.size commits)\n$branchBreak" + changes += "\n$branchBreak $ref branch updated [NON fast-forward] ($commits.size commits)\n$branchBreak" changes += commits.collect(table).join(commitBreak) changes += '\n' break case ReceiveCommand.Type.DELETE: // deleted branch/tag - changes += "$branchBreak $ref deleted\n$branchBreak" + changes += "\n$branchBreak $ref deleted\n$branchBreak" break default: break @@ -173,4 +173,4 @@ r.close() // tell Gitblit to send the message (Gitblit filters duplicate addresses) -gitblit.sendMail("$emailprefix $user.username pushed $commitCount commits => $repository.name", "$summaryUrl\n\n$changes", toAddresses) \ No newline at end of file +gitblit.sendMail("$emailprefix $user.username pushed $commitCount commits => $repository.name", "$summaryUrl\n$changes", toAddresses) \ No newline at end of file -- Gitblit v1.9.1