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()})