summaryrefslogtreecommitdiff
path: root/git.go
blob: 9625c7d302449f1c5400aec17a8c294dd77569ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package repostatus

// most everything here needs to be deprecated now
func (rs *RepoStatus) Path() string {
	return rs.realPath.String()
}

/*
func (rs *RepoStatus) GitState() string {
	return rs.gitState.String()
}
*/

func (rs *RepoStatus) GetStatus() string {
	return rs.gitState.String()
}

func (rs *RepoStatus) GetLastTagVersion() string {
	return rs.lasttag.String()
}

func (rs *RepoStatus) displayCurrentBranchName() string {
	out := rs.pb.GetCurrentBranchName()
	rs.currentBranch.SetValue(out)
	return out
}

// stores the current branch name
func (rs *RepoStatus) checkCurrentBranchName() string {
	currentname := rs.currentBranch.String()
	out := rs.pb.GetCurrentBranchName()
	if currentname == out {
		// nothing changed
		return currentname
	}
	rs.currentBranch.SetValue(out)
	if currentname == "" {
		return out // don't note if there was nothing before
	}
	rs.NoteChange("current branch has changed from " + currentname + " to " + out)
	return out
}