From 200289c76a6ce7dd54545de4f09421e5607455a8 Mon Sep 17 00:00:00 2001 From: chriswalz Date: Sun, 4 Jul 2021 14:14:56 -0400 Subject: [PATCH] fix: cloud branch exists sometimes not correctly work on some versions of git --- cmd/git.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/git.go b/cmd/git.go index f186834..2d67040 100644 --- a/cmd/git.go +++ b/cmd/git.go @@ -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 {