aboutsummaryrefslogtreecommitdiffstats
path: root/remote.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-10-27 02:42:36 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-10-27 02:42:36 +0200
commit0c6c4047155692caff733d0cd239b80508b7bd04 (patch)
tree522bc02e7c5e4f4f3968a7b38c74bc9773097d1f /remote.go
parent0c3bc0c8b3eabe16e927475f26044ca9aaa50351 (diff)
downloadgo-git-0c6c4047155692caff733d0cd239b80508b7bd04.tar.gz
remote, fix fetch tags
Diffstat (limited to 'remote.go')
-rw-r--r--remote.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/remote.go b/remote.go
index 7814255..e7028e8 100644
--- a/remote.go
+++ b/remote.go
@@ -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
}