Skip to content

Commit

Permalink
fix: cloud branch exists sometimes not correctly work on some version…
Browse files Browse the repository at this point in the history
…s of git
  • Loading branch information
chriswalz committed Jul 4, 2021
1 parent c7879cd commit 200289c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import (
)

func CloudBranchExists() bool {
msg, err := execCommand("git", "pull").CombinedOutput()
msg, err := execCommand("git", "diff", "@{u}").CombinedOutput()
if err != nil {
log.Debug().Err(err).Send()
}
// log.Println("msg:", string(msg))
// log.Println("err:", err)
return !strings.Contains(string(msg), "There is no tracking information for the current branch")
return !strings.Contains(string(msg), "fatal: no upstream configured for branch")
}

func CurrentBranch() string {
Expand Down

0 comments on commit 200289c

Please sign in to comment.