diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-10-27 02:42:36 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-10-27 02:42:36 +0200 |
commit | 0c6c4047155692caff733d0cd239b80508b7bd04 (patch) | |
tree | 522bc02e7c5e4f4f3968a7b38c74bc9773097d1f /remote.go | |
parent | 0c3bc0c8b3eabe16e927475f26044ca9aaa50351 (diff) | |
download | go-git-0c6c4047155692caff733d0cd239b80508b7bd04.tar.gz |
remote, fix fetch tags
Diffstat (limited to 'remote.go')
-rw-r--r-- | remote.go | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -120,13 +120,23 @@ func (r *Remote) getWantedReferences(spec []config.RefSpec) ([]*core.Reference, return refs, err } + wantTags := true + for _, s := range spec { + if !s.IsWildcard() { + wantTags = false + break + } + } + return refs, iter.ForEach(func(ref *core.Reference) error { if ref.Type() != core.HashReference { return nil } if !config.MatchAny(spec, ref.Name()) { - return nil + if !ref.IsTag() || !wantTags { + return nil + } } _, err := r.s.ObjectStorage().Get(core.CommitObject, ref.Hash()) @@ -223,7 +233,7 @@ func (r *Remote) buildFetchedTags() error { return nil } - _, err := os.Get(core.CommitObject, ref.Hash()) + _, err := os.Get(core.AnyObject, ref.Hash()) if err == core.ErrObjectNotFound { return nil } |