aboutsummaryrefslogtreecommitdiffstats
path: root/config/refspec.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-08-22 00:18:02 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-08-22 00:18:02 +0200
commitf42d82364c5d159f65a48e720433ad2bc97f0b7f (patch)
tree82623f4163625786f4e8e41028dcd1c7abaf209f /config/refspec.go
parenta045606fc9c5cbf30b409384cbdad4804f01c61d (diff)
downloadgo-git-f42d82364c5d159f65a48e720433ad2bc97f0b7f.tar.gz
Remote.Fetch multiple RefSpec support
Diffstat (limited to 'config/refspec.go')
-rw-r--r--config/refspec.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/config/refspec.go b/config/refspec.go
index e74bf78..dae13be 100644
--- a/config/refspec.go
+++ b/config/refspec.go
@@ -112,3 +112,14 @@ func (s RefSpec) Dst(n core.ReferenceName) core.ReferenceName {
func (s RefSpec) String() string {
return string(s)
}
+
+// MatchAny returns true if any of the RefSpec match with the given ReferenceName
+func MatchAny(l []RefSpec, n core.ReferenceName) bool {
+ for _, r := range l {
+ if r.Match(n) {
+ return true
+ }
+ }
+
+ return false
+}