add the concept of "mode" for the git repos

This commit is contained in:
Jeff Carr 2024-02-25 13:10:44 -06:00
parent 9a1347c03f
commit fc849f6003
1 changed files with 24 additions and 0 deletions

View File

@ -444,3 +444,27 @@ func (rs *RepoStatus) setMergeUserCommands() {
rs.versionCmdOutput.SetValue(strings.Join(tmp, "\n")) rs.versionCmdOutput.SetValue(strings.Join(tmp, "\n"))
} }
func (rs *RepoStatus) IsCorrectMode(mode string) bool {
switch mode {
case "master":
if rs.GetCurrentBranchName() == rs.GetMasterBranchName() {
return true
} else {
return false
}
case "devel":
if rs.GetCurrentBranchName() == rs.GetDevelBranchName() {
return true
} else {
return false
}
case "user":
if rs.GetCurrentBranchName() == rs.GetUserBranchName() {
return true
} else {
return false
}
}
return false
}