diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2020-04-07 09:37:34 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2020-04-07 09:37:34 +0200 |
commit | 7f7ab529081953fb91783301b5f4eb3c5d2dfdb0 (patch) | |
tree | cabd1ddd923bac0ac052b0187a35469a00cf368a /plumbing/protocol/packp/advrefs.go | |
parent | e04168bb11a960018b6bbabd6972fd33163b6f28 (diff) | |
download | go-git-7f7ab529081953fb91783301b5f4eb3c5d2dfdb0.tar.gz |
plumbing: transport, fix handling of empty adv-refs on upload-pack
Diffstat (limited to 'plumbing/protocol/packp/advrefs.go')
-rw-r--r-- | plumbing/protocol/packp/advrefs.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/plumbing/protocol/packp/advrefs.go b/plumbing/protocol/packp/advrefs.go index ab286c6..1bd724c 100644 --- a/plumbing/protocol/packp/advrefs.go +++ b/plumbing/protocol/packp/advrefs.go @@ -201,3 +201,11 @@ func (a *AdvRefs) addSymbolicRefs(s storer.ReferenceStorer) error { func (a *AdvRefs) supportSymrefs() bool { return a.Capabilities.Supports(capability.SymRef) } + +// IsEmpty returns true if doesn't contain any reference. +func (a *AdvRefs) IsEmpty() bool { + return a.Head == nil && + len(a.References) == 0 && + len(a.Peeled) == 0 && + len(a.Shallows) == 0 +} |