GetPath() & CheckoutBranch()
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
78a3adeb15
commit
cf3d56475d
15
git.go
15
git.go
|
@ -8,12 +8,18 @@ import (
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func (rs *RepoStatus) GetPath() string {
|
||||||
|
return rs.repopath
|
||||||
|
}
|
||||||
|
|
||||||
func (rs *RepoStatus) GetCurrentBranchName() string {
|
func (rs *RepoStatus) GetCurrentBranchName() string {
|
||||||
return rs.currentBranch.Get()
|
return rs.currentBranch.Get()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rs *RepoStatus) GetCurrentBranchVersion() string {
|
func (rs *RepoStatus) GetCurrentBranchVersion() string {
|
||||||
return rs.currentVersion.Get()
|
return rs.currentVersion.Get()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rs *RepoStatus) GetLastTagVersion() string {
|
func (rs *RepoStatus) GetLastTagVersion() string {
|
||||||
return rs.lasttag.Get()
|
return rs.lasttag.Get()
|
||||||
}
|
}
|
||||||
|
@ -113,6 +119,15 @@ func (rs *RepoStatus) CheckDirty() bool {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (rs *RepoStatus) CheckoutBranch(branch string) (string, string) {
|
||||||
|
// run(rs.repopath, "git", "checkout " + branch)
|
||||||
|
|
||||||
|
realname := rs.getCurrentBranchName()
|
||||||
|
realversion := rs.getCurrentBranchVersion()
|
||||||
|
log.Warn(rs.repopath, "realname =", realname, "realversion =", realversion)
|
||||||
|
return realname, realversion
|
||||||
|
}
|
||||||
|
|
||||||
func (rs *RepoStatus) checkoutBranch(level string, branch string) {
|
func (rs *RepoStatus) checkoutBranch(level string, branch string) {
|
||||||
if rs.CheckDirty() {
|
if rs.CheckDirty() {
|
||||||
log.Warn("checkoutBranch() checkDirty() == true for repo", rs.repopath, "looking for branch:", branch)
|
log.Warn("checkoutBranch() checkDirty() == true for repo", rs.repopath, "looking for branch:", branch)
|
||||||
|
|
Loading…
Reference in New Issue