Pārlūkot izejas kodu

Check for non-fast-forward update error on push

Brendan Abolivier 7 gadus atpakaļ
vecāks
revīzija
cc1d718d23
Parakstījis: Brendan Abolivier <contact@brendanabolivier.com> GPG atslēgas ID: 8EF1500759F70623
1 mainītis faili ar 6 papildinājumiem un 0 dzēšanām
  1. 6
    0
      src/git/git.go

+ 6
- 0
src/git/git.go Parādīt failu

@@ -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
 }