Skip to content

Commit

Permalink
Improve branch existence check
Browse files Browse the repository at this point in the history
  • Loading branch information
Shell32-Natsu committed May 21, 2020
1 parent 68d6b9a commit 1dced55
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion releasing/releasing/releasing.go
Expand Up @@ -376,7 +376,13 @@ func checkBranchExistence(path, name string) bool {
if err != nil {
logFatal(string(stdoutStderr))
}
return strings.Contains(string(stdoutStderr), name)
branches := strings.Split(string(stdoutStderr), "\n")
for _, branch := range branches {
if strings.Trim(branch, " ") == "remotes/"+name {
return true
}
}
return false
}

func newBranch(path, name string) {
Expand Down

0 comments on commit 1dced55

Please sign in to comment.