Skip to content

Commit e2c1f79

Browse files
committed
Fix newline in git module repo names breaking display
After setting up the git module with multiple repos and switching between them, I observed some graphical wonkiness in the display: https://i.imgur.com/R3e7eij.png After adding some log statements, I tracked it down to the `GitRepo.Repository` field having a newline in it after it's set from a command execution's stdout. This change strips the repository path of spaces when assigning to the `Repository` field, which fixes the display issues.
1 parent 30aca0a commit e2c1f79

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎git/git_repo.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func NewGitRepo(repoPath string) *GitRepo {
2222
repo.Branch = repo.branch()
2323
repo.ChangedFiles = repo.changedFiles()
2424
repo.Commits = repo.commits()
25-
repo.Repository = repo.repository()
25+
repo.Repository = strings.TrimSpace(repo.repository())
2626

2727
return &repo
2828
}

0 commit comments

Comments
 (0)
⌂ 换网址