gitpb/common.go

56 lines
1014 B
Go

package gitpb
func (repo *Repo) SetReadOnly(b bool) {
repo.ReadOnly = b
}
func (repo *Repo) SetTargetVersion(target string) {
repo.TargetVersion = target
}
func (repo *Repo) SetMasterBranchName(s string) {
repo.MasterBranchName = s
}
func (repo *Repo) GetGoPath() string {
if repo.GoInfo == nil {
return ""
}
return repo.GoInfo.GoPath
}
func (repo *Repo) GetGoPrimitive() bool {
if repo.GoInfo == nil {
return false
}
return repo.GoInfo.GoPrimitive
}
func (repo *Repo) SetGoPrimitive(b bool) {
if repo.GoInfo == nil {
repo.GoInfo = new(GoInfo)
}
repo.GoInfo.GoPrimitive = b
}
func (repo *Repo) IsUserBranch() bool {
if repo.GetCurrentBranchName() == repo.GetUserBranchName() {
return true
}
return false
}
func (repo *Repo) IsMasterBranch() bool {
if repo.GetCurrentBranchName() == repo.GetMasterBranchName() {
return true
}
return false
}
func (repo *Repo) IsDevelBranch() bool {
if repo.GetCurrentBranchName() == repo.GetDevelBranchName() {
return true
}
return false
}