From bbe6f49cd00f58cca0d8056ea9febedc6aba67de Mon Sep 17 00:00:00 2001 From: nnnkkk7 Date: Wed, 31 Jan 2024 23:22:47 +0900 Subject: [PATCH] avoid using '!' Signed-off-by: nnnkkk7 --- pkg/app/piped/eventwatcher/eventwatcher.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/app/piped/eventwatcher/eventwatcher.go b/pkg/app/piped/eventwatcher/eventwatcher.go index da61dcf8e4..c581d19006 100644 --- a/pkg/app/piped/eventwatcher/eventwatcher.go +++ b/pkg/app/piped/eventwatcher/eventwatcher.go @@ -791,8 +791,8 @@ func parseCommitMsg(msg string, args argsTemplate) string { // makeBranchName generates a new branch name in the format {eventName}-{uuid} if newBranch is true. // If newBranch is false, the function returns the existing branch name. func makeBranchName(newBranch bool, eventName, branch string) string { - if !newBranch { - return branch + if newBranch { + fmt.Sprintf("%s-%s", eventName, uuid.New().String()) } - return fmt.Sprintf("%s-%s", eventName, uuid.New().String()) + return branch }