From b2d3d13ed9992aab812184009303e1a1be305194 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 2 Mar 2024 13:35:43 -0600 Subject: [PATCH] get the proper devel branch name --- revert.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/revert.go b/revert.go index 22a6041..201c1db 100644 --- a/revert.go +++ b/revert.go @@ -11,6 +11,7 @@ func (rs *RepoStatus) RevertMasterToDevel() bool { } curName := rs.GetCurrentBranchName() + dName := rs.GetDevelBranchName() mName := rs.GetMasterBranchName() if curName != mName { log.Info("repo is not working from main branch", curName, "!=", mName) @@ -19,19 +20,14 @@ func (rs *RepoStatus) RevertMasterToDevel() bool { log.Info("reset master to devel", curName, rs.String()) - // git checkout devel - // git branch -D master - // git branch master - // git checkout master - // git push --set-upstream --force origin master - var all [][]string - all = append(all, []string{"git", "checkout", "devel"}) + all = append(all, []string{"git", "checkout", dName}) // switch to the devel branch all = append(all, []string{"git", "branch", "-D", mName}) - all = append(all, []string{"git", "branch", mName}) + all = append(all, []string{"git", "branch", mName}) // make a master branch based on devel all = append(all, []string{"git", "checkout", mName}) all = append(all, []string{"git", "push", "--set-upstream", "--force", "origin", mName}) + // don't do anything with tags here // all = append(all, []string{"git", "tag", "--delete", release.version.String()}) // all = append(all, []string{"git", "push", "--delete", "origin", release.version.String()})