diff options
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 } |