mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-11-22 04:42:37 +03:00
Modernize all codes
go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix -test ./...
This commit is contained in:
@@ -59,9 +59,9 @@ func (self *ReposHelper) getCurrentBranch(path string) string {
|
||||
content := strings.TrimSpace(string(headFile))
|
||||
refsPrefix := "ref: refs/heads/"
|
||||
var branchDisplay string
|
||||
if strings.HasPrefix(content, refsPrefix) {
|
||||
if bareName, ok := strings.CutPrefix(content, refsPrefix); ok {
|
||||
// is a branch
|
||||
branchDisplay = strings.TrimPrefix(content, refsPrefix)
|
||||
branchDisplay = bareName
|
||||
} else {
|
||||
// detached HEAD state, displaying short hash
|
||||
branchDisplay = utils.ShortHash(content)
|
||||
|
||||
Reference in New Issue
Block a user