diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-07 19:16:54 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-07 19:16:54 +1000 |
commit | c4f3637e217cef1521fa98f354a244888040f0b0 (patch) | |
tree | d64a66402fcec72b06045f3d10b1dacaa7c52105 /gitcommands.go | |
parent | 6cf6fecb64b71eaa9de78f66b5dee5a2e84371cb (diff) |
better function name
Diffstat (limited to 'gitcommands.go')
-rw-r--r-- | gitcommands.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gitcommands.go b/gitcommands.go index c889f0759..ee0fd9a33 100644 --- a/gitcommands.go +++ b/gitcommands.go @@ -165,7 +165,7 @@ func withPadding(str string, padding int) string { return str + strings.Repeat(" ", padding-len(str)) } -func branchFromLine(recency, name string, index int) Branch { +func constructBranch(recency, name string, index int) Branch { branchType, branchBase, colourAttr := branchPropertiesFromName(name) if index == 0 { recency = " *" @@ -184,7 +184,7 @@ func getGitBranches() []Branch { // check if there are any branches branchCheck, _ := runCommand("git branch") if branchCheck == "" { - return []Branch{branchFromLine("", gitCurrentBranchName(), 0)} + return []Branch{constructBranch("", gitCurrentBranchName(), 0)} } branches := getBranches() branches = getAndMergeFetchedBranches(branches) @@ -216,7 +216,7 @@ func getAndMergeFetchedBranches(branches []Branch) []Branch { if branchAlreadyStored(line, branches) { continue } - branches = append(branches, branchFromLine("", line, len(branches))) + branches = append(branches, constructBranch("", line, len(branches))) } return branches } @@ -566,7 +566,7 @@ func getBranches() []Branch { } timeUnit = timeUnitMap[timeUnit] - branch := branchFromLine(timeNumber+timeUnit, branchName, i) + branch := constructBranch(timeNumber+timeUnit, branchName, i) branches = append(branches, branch) } return branches |