diff options
author | Andrew Suffield <asuffield@gmail.com> | 2021-03-26 16:03:49 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-26 17:03:49 +0100 |
commit | e5bbc4d10904554dbc8fd5afd06f66814f7b173e (patch) | |
tree | 6a1508b51ede537c75896ba6650a8f5fb0ad09f8 /plumbing/transport/server/server.go | |
parent | 1f328388192915476c68e5e0c8c1c818fd50fc6b (diff) | |
download | go-git-e5bbc4d10904554dbc8fd5afd06f66814f7b173e.tar.gz |
plumbing: wire up contexts for Transport.AdvertisedReferences (#246)
* plumbing: wire up contexts for Transport.AdvertisedReferences
* add more tests for context wiring
Diffstat (limited to 'plumbing/transport/server/server.go')
-rw-r--r-- | plumbing/transport/server/server.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/plumbing/transport/server/server.go b/plumbing/transport/server/server.go index 727f902..6f89ec3 100644 --- a/plumbing/transport/server/server.go +++ b/plumbing/transport/server/server.go @@ -108,6 +108,10 @@ type upSession struct { } func (s *upSession) AdvertisedReferences() (*packp.AdvRefs, error) { + return s.AdvertisedReferencesContext(context.TODO()) +} + +func (s *upSession) AdvertisedReferencesContext(ctx context.Context) (*packp.AdvRefs, error) { ar := packp.NewAdvRefs() if err := s.setSupportedCapabilities(ar.Capabilities); err != nil { @@ -204,6 +208,10 @@ type rpSession struct { } func (s *rpSession) AdvertisedReferences() (*packp.AdvRefs, error) { + return s.AdvertisedReferencesContext(context.TODO()) +} + +func (s *rpSession) AdvertisedReferencesContext(ctx context.Context) (*packp.AdvRefs, error) { ar := packp.NewAdvRefs() if err := s.setSupportedCapabilities(ar.Capabilities); err != nil { |