aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/server/server.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2020-03-19 15:27:26 +0100
committerGitHub <noreply@github.com>2020-03-19 15:27:26 +0100
commitf6305131a06bd94ef39e444b60f773db75b054f6 (patch)
tree5165824443497a01df13657d0128766fd852b865 /plumbing/transport/server/server.go
parent1dbaf49cde7bc189fb05b875aec535b124d7dc43 (diff)
parentcec6ee36305b9d64abf78bfac637eb164be1217a (diff)
downloadgo-git-f6305131a06bd94ef39e444b60f773db75b054f6.tar.gz
Merge pull request #11 from brandonwestcott/fix/empty-packfile-server
plumbing: transport server check for nil Packfile, fixes ref deletes
Diffstat (limited to 'plumbing/transport/server/server.go')
-rw-r--r--plumbing/transport/server/server.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/plumbing/transport/server/server.go b/plumbing/transport/server/server.go
index 71845e3..727f902 100644
--- a/plumbing/transport/server/server.go
+++ b/plumbing/transport/server/server.go
@@ -243,11 +243,13 @@ func (s *rpSession) ReceivePack(ctx context.Context, req *packp.ReferenceUpdateR
//TODO: Implement 'atomic' update of references.
- r := ioutil.NewContextReadCloser(ctx, req.Packfile)
- if err := s.writePackfile(r); err != nil {
- s.unpackErr = err
- s.firstErr = err
- return s.reportStatus(), err
+ if req.Packfile != nil {
+ r := ioutil.NewContextReadCloser(ctx, req.Packfile)
+ if err := s.writePackfile(r); err != nil {
+ s.unpackErr = err
+ s.firstErr = err
+ return s.reportStatus(), err
+ }
}
s.updateReferences(req)