aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/http/fetch_pack.go
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/transport/http/fetch_pack.go')
-rw-r--r--plumbing/transport/http/fetch_pack.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/plumbing/transport/http/fetch_pack.go b/plumbing/transport/http/fetch_pack.go
index 1548110..0c85be4 100644
--- a/plumbing/transport/http/fetch_pack.go
+++ b/plumbing/transport/http/fetch_pack.go
@@ -17,7 +17,6 @@ import (
type fetchPackSession struct {
*session
- advRefsRun bool
}
func newFetchPackSession(c *http.Client,
@@ -33,12 +32,10 @@ func newFetchPackSession(c *http.Client,
}
func (s *fetchPackSession) AdvertisedReferences() (*packp.AdvRefs, error) {
- if s.advRefsRun {
- return nil, transport.ErrAdvertistedReferencesAlreadyCalled
+ if s.advRefs != nil {
+ return s.advRefs, nil
}
- defer func() { s.advRefsRun = true }()
-
url := fmt.Sprintf(
"%s/info/refs?service=%s",
s.endpoint.String(), transport.UploadPackServiceName,
@@ -72,6 +69,7 @@ func (s *fetchPackSession) AdvertisedReferences() (*packp.AdvRefs, error) {
}
transport.FilterUnsupportedCapabilities(ar.Capabilities)
+ s.advRefs = ar
return ar, nil
}