Fixed the broken source branch thing
This commit is contained in:
parent
16fd63b06f
commit
74488ff5da
1 changed files with 4 additions and 4 deletions
|
|
@ -8,6 +8,7 @@ import (
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"strings"
|
"strings"
|
||||||
"text/template"
|
"text/template"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Services struct {
|
type Services struct {
|
||||||
|
|
@ -69,13 +70,12 @@ func (s *Services) PushRepository() error {
|
||||||
|
|
||||||
sourceBranch := s.cfg.LocalBranch
|
sourceBranch := s.cfg.LocalBranch
|
||||||
if sourceBranch == "" {
|
if sourceBranch == "" {
|
||||||
// Get the current ref
|
makeTempBranch := fmt.Sprintf("release_%v", time.Now().Format(`20060102150405`))
|
||||||
ref, err := runCmdExpectingOutput("git", "rev-parse", "HEAD")
|
if err := runCmd("git", "checkout", "-b", makeTempBranch); err != nil {
|
||||||
if err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceBranch = strings.TrimSpace(ref)
|
sourceBranch = strings.TrimSpace(makeTempBranch)
|
||||||
}
|
}
|
||||||
remoteBranch := s.cfg.RemoteBranch
|
remoteBranch := s.cfg.RemoteBranch
|
||||||
if remoteBranch == "" {
|
if remoteBranch == "" {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue