diff --git a/services.go b/services.go index 528338b..c4548e3 100644 --- a/services.go +++ b/services.go @@ -8,7 +8,6 @@ import ( "os/exec" "strings" "text/template" - "time" ) type Services struct { @@ -74,12 +73,13 @@ func (s *Services) PushRepository() error { sourceBranch := s.cfg.LocalBranch if sourceBranch == "" { - makeTempBranch := fmt.Sprintf("release_%v", time.Now().Format(`20060102150405`)) - if err := runCmd("git", "checkout", "-b", makeTempBranch); err != nil { + // Get the current ref + ref, err := runCmdExpectingOutput("git", "rev-parse", "HEAD") + if err != nil { return err } - sourceBranch = strings.TrimSpace(makeTempBranch) + sourceBranch = strings.TrimSpace(ref) } remoteBranch := s.cfg.RemoteBranch if remoteBranch == "" {