get the proper devel branch name

This commit is contained in:
Jeff Carr 2024-03-02 13:35:43 -06:00
parent b12bc0a9ec
commit b2d3d13ed9
1 changed files with 4 additions and 8 deletions

View File

@ -11,6 +11,7 @@ func (rs *RepoStatus) RevertMasterToDevel() bool {
} }
curName := rs.GetCurrentBranchName() curName := rs.GetCurrentBranchName()
dName := rs.GetDevelBranchName()
mName := rs.GetMasterBranchName() mName := rs.GetMasterBranchName()
if curName != mName { if curName != mName {
log.Info("repo is not working from main branch", 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()) 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 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", "-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", "checkout", mName})
all = append(all, []string{"git", "push", "--set-upstream", "--force", "origin", 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", "tag", "--delete", release.version.String()})
// all = append(all, []string{"git", "push", "--delete", "origin", release.version.String()}) // all = append(all, []string{"git", "push", "--delete", "origin", release.version.String()})