summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Kopenga <mkopenga@gmail.com>2018-08-15 10:54:43 +0200
committerGitHub <noreply@github.com>2018-08-15 10:54:43 +0200
commit10c53162ca99250b25ec15dbfad66f425af35342 (patch)
tree3bfa080deadce0bf74b9b091a28706992058417c
parent7e926cf41da55461fbd02d2a4ce4e3c2318db0a8 (diff)
parentdb140842f3c10921153b3e19e66dd72b39fa00f8 (diff)
Merge pull request #3 from jesseduffield/master
Updated to latest master
-rw-r--r--VERSION2
-rw-r--r--pkg/git/branch_list_builder.go7
2 files changed, 6 insertions, 3 deletions
diff --git a/VERSION b/VERSION
index 21d9c94d5..e26c92f2c 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-v0.1.59 \ No newline at end of file
+v0.1.61 \ No newline at end of file
diff --git a/pkg/git/branch_list_builder.go b/pkg/git/branch_list_builder.go
index 41e59c093..869e05c98 100644
--- a/pkg/git/branch_list_builder.go
+++ b/pkg/git/branch_list_builder.go
@@ -39,7 +39,10 @@ func (b *BranchListBuilder) obtainCurrentBranch() commands.Branch {
// even though you're on 'master'
branchName, err := b.GitCommand.OSCommand.RunCommandWithOutput("git symbolic-ref --short HEAD")
if err != nil {
- panic(err.Error())
+ branchName, err = b.GitCommand.OSCommand.RunCommandWithOutput("git rev-parse --short HEAD")
+ if err != nil {
+ panic(err.Error())
+ }
}
return commands.Branch{Name: strings.TrimSpace(branchName), Recency: " *"}
}
@@ -141,7 +144,7 @@ func branchInfoFromLine(line string) (string, string, string) {
r := regexp.MustCompile("\\|.*\\s")
line = r.ReplaceAllString(line, " ")
words := strings.Split(line, " ")
- return words[0], words[1], words[3]
+ return words[0], words[1], words[len(words)-1]
}
func abbreviatedTimeUnit(timeUnit string) string {