force checkout. need to warn users

This commit is contained in:
Jeff Carr 2024-12-03 01:57:31 -06:00
parent cbdcfa0589
commit 6342113c2a
1 changed files with 21 additions and 3 deletions

View File

@ -28,7 +28,13 @@ func (f *Forge) VerifyBranchNames(newr *gitpb.Repo) {
} else if newr.IsBranch("main") {
newr.SetMasterBranchName("main")
} else {
newr.SetMasterBranchName("masterFIXME")
// todo, figure out the name from git
newr.SetMasterBranchName("master")
if newr.CheckoutMaster() {
} else {
cmd := []string{"git", "branch", "master"}
newr.Run(cmd)
}
}
}
@ -42,7 +48,13 @@ func (f *Forge) VerifyBranchNames(newr *gitpb.Repo) {
} else if newr.IsBranch("devel") {
newr.SetDevelBranchName("devel")
} else {
newr.SetDevelBranchName("develFIXME")
// forcing for now. todo: warn users
newr.SetDevelBranchName("devel")
if newr.CheckoutDevel() {
} else {
cmd := []string{"git", "branch", "devel"}
newr.Run(cmd)
}
}
}
@ -52,7 +64,13 @@ func (f *Forge) VerifyBranchNames(newr *gitpb.Repo) {
if newr.IsBranch(uname) {
newr.SetUserBranchName(uname)
} else {
newr.SetUserBranchName(uname + "FIXME")
// forcing for now. todo: warn users
newr.SetUserBranchName(uname)
if newr.CheckoutUser() {
} else {
cmd := []string{"git", "branch", uname}
newr.Run(cmd)
}
}
}
}