瀏覽代碼

Fix wrong call to HasPrefix

Brendan Abolivier 6 年之前
父節點
當前提交
c680c2a359
簽署人: Brendan Abolivier <contact@brendanabolivier.com> GPG 金鑰 ID: 8EF1500759F70623
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      src/git/git.go

+ 2
- 2
src/git/git.go 查看文件

@@ -75,7 +75,7 @@ func pull(clonePath string, auth *gitssh.PublicKeys) (*gogit.Repository, error)
75 75
 
76 76
 	// go-git doesn't have an error variable for "non-fast-forward update", so
77 77
 	// this is the only way to detect it
78
-	if strings.HasPrefix("non-fast-forward update", err.Error()) {
78
+	if strings.HasPrefix(err.Error(), "non-fast-forward update") {
79 79
 		return r, nil
80 80
 	}
81 81
 
@@ -108,7 +108,7 @@ func Push(r *gogit.Repository, cfg config.GitSettings) error {
108 108
 
109 109
 	// go-git doesn't have an error variable for "non-fast-forward update", so
110 110
 	// this is the only way to detect it
111
-	if strings.HasPrefix("non-fast-forward update", err.Error()) {
111
+	if strings.HasPrefix(err.Error(), "non-fast-forward update") {
112 112
 		return nil
113 113
 	}
114 114