diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2020-04-07 17:26:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-07 17:26:02 +0200 |
commit | 9c2ab26437152c9a92f66afb51a28c0142f704ad (patch) | |
tree | e82447e0fa27fccaf891e3a61dc6c20d3bbf3a09 /plumbing/protocol/packp/advrefs.go | |
parent | 8fddd7abcc436d77e9f7449a7b7aa15ee13f7c60 (diff) | |
parent | 7f7ab529081953fb91783301b5f4eb3c5d2dfdb0 (diff) | |
download | go-git-9c2ab26437152c9a92f66afb51a28c0142f704ad.tar.gz |
Merge pull request #22 from mcuadros/fix-empty
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 +} |