1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-08 23:56:15 +02:00

better function name

This commit is contained in:
Jesse Duffield 2018-08-07 19:16:54 +10:00
parent 6cf6fecb64
commit c4f3637e21

View File

@ -165,7 +165,7 @@ func withPadding(str string, padding int) string {
return str + strings.Repeat(" ", padding-len(str)) 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) branchType, branchBase, colourAttr := branchPropertiesFromName(name)
if index == 0 { if index == 0 {
recency = " *" recency = " *"
@ -184,7 +184,7 @@ func getGitBranches() []Branch {
// check if there are any branches // check if there are any branches
branchCheck, _ := runCommand("git branch") branchCheck, _ := runCommand("git branch")
if branchCheck == "" { if branchCheck == "" {
return []Branch{branchFromLine("", gitCurrentBranchName(), 0)} return []Branch{constructBranch("", gitCurrentBranchName(), 0)}
} }
branches := getBranches() branches := getBranches()
branches = getAndMergeFetchedBranches(branches) branches = getAndMergeFetchedBranches(branches)
@ -216,7 +216,7 @@ func getAndMergeFetchedBranches(branches []Branch) []Branch {
if branchAlreadyStored(line, branches) { if branchAlreadyStored(line, branches) {
continue continue
} }
branches = append(branches, branchFromLine("", line, len(branches))) branches = append(branches, constructBranch("", line, len(branches)))
} }
return branches return branches
} }
@ -566,7 +566,7 @@ func getBranches() []Branch {
} }
timeUnit = timeUnitMap[timeUnit] timeUnit = timeUnitMap[timeUnit]
branch := branchFromLine(timeNumber+timeUnit, branchName, i) branch := constructBranch(timeNumber+timeUnit, branchName, i)
branches = append(branches, branch) branches = append(branches, branch)
} }
return branches return branches