浏览代码

Check for non-fast-forward update error on push

父节点
当前提交
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
 }