瀏覽代碼

Check for non-fast-forward update error on push

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

+ 6
- 0
src/git/git.go 查看文件

@@ -106,5 +106,11 @@ func Push(r *gogit.Repository, cfg config.GitSettings) error {
106 106
 		return nil
107 107
 	}
108 108
 
109
+	// go-git doesn't have an error variable for "non-fast-forward update", so
110
+	// this is the only way to detect it
111
+	if strings.HasPrefix("non-fast-forward update", err.Error()) {
112
+		return nil
113
+	}
114
+
109 115
 	return err
110 116
 }