From fc849f6003df637c942a6e9fe2a722069a10d739 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 25 Feb 2024 13:10:44 -0600 Subject: [PATCH] add the concept of "mode" for the git repos --- merge.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/merge.go b/merge.go index 8dcc716..ed900db 100644 --- a/merge.go +++ b/merge.go @@ -444,3 +444,27 @@ func (rs *RepoStatus) setMergeUserCommands() { 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 +}