aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/protocol/packp/uppackreq.go
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/protocol/packp/uppackreq.go')
-rw-r--r--plumbing/protocol/packp/uppackreq.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/plumbing/protocol/packp/uppackreq.go b/plumbing/protocol/packp/uppackreq.go
index 887d27a..84e2b4e 100644
--- a/plumbing/protocol/packp/uppackreq.go
+++ b/plumbing/protocol/packp/uppackreq.go
@@ -13,15 +13,16 @@ import (
// UploadPackRequest represents a upload-pack request.
// Zero-value is not safe, use NewUploadPackRequest instead.
type UploadPackRequest struct {
- *UploadRequest
- *UploadHaves
+ UploadRequest
+ UploadHaves
}
// NewUploadPackRequest creates a new UploadPackRequest and returns a pointer.
func NewUploadPackRequest() *UploadPackRequest {
+ ur := NewUploadRequest()
return &UploadPackRequest{
- UploadHaves: &UploadHaves{},
- UploadRequest: NewUploadRequest(),
+ UploadHaves: UploadHaves{},
+ UploadRequest: *ur,
}
}
@@ -30,9 +31,10 @@ func NewUploadPackRequest() *UploadPackRequest {
// ones, based on the adv value (advertaised capabilities), the UploadPackRequest
// it has no wants, haves or shallows and an infinite depth
func NewUploadPackRequestFromCapabilities(adv *capability.List) *UploadPackRequest {
+ ur := NewUploadRequestFromCapabilities(adv)
return &UploadPackRequest{
- UploadHaves: &UploadHaves{},
- UploadRequest: NewUploadRequestFromCapabilities(adv),
+ UploadHaves: UploadHaves{},
+ UploadRequest: *ur,
}
}