Skip to content

Commit

Permalink
Fix newline in git module repo names breaking display
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
baustinanki authored and Chris Cummer committed Jun 13, 2018
1 parent bf2a27d commit d6b500e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git/git_repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func NewGitRepo(repoPath string) *GitRepo {
repo.Branch = repo.branch()
repo.ChangedFiles = repo.changedFiles()
repo.Commits = repo.commits()
repo.Repository = repo.repository()
repo.Repository = strings.TrimSpace(repo.repository())

return &repo
}
Expand Down

0 comments on commit d6b500e

Please sign in to comment.