diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-14 17:47:33 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-14 17:47:33 +1000 |
commit | 9ecd7908aaefcda1f3654728aa20a4f5ca648b5c (patch) | |
tree | 2d1fea619acb25cc83e75acc7e3da55106ad7fcd /pkg/git | |
parent | 95c7df4c61a31a0940eee4981beda78981c651eb (diff) |
refactor commands to depend less on the shell
Diffstat (limited to 'pkg/git')
-rw-r--r-- | pkg/git/branch_list_builder.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/git/branch_list_builder.go b/pkg/git/branch_list_builder.go index faa073119..384d5b864 100644 --- a/pkg/git/branch_list_builder.go +++ b/pkg/git/branch_list_builder.go @@ -37,7 +37,10 @@ func NewBranchListBuilder(log *logrus.Logger, gitCommand *commands.GitCommand) ( func (b *BranchListBuilder) obtainCurrentBranch() commands.Branch { // I used go-git for this, but that breaks if you've just done a git init, // even though you're on 'master' - branchName, _ := b.GitCommand.OSCommand.RunDirectCommand("git symbolic-ref --short HEAD") + branchName, err := b.GitCommand.OSCommand.RunCommandWithOutput("git symbolic-ref --short HEAD") + if err != nil { + panic(err.Error()) + } return commands.Branch{Name: strings.TrimSpace(branchName), Recency: " *"} } |