aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/server
diff options
context:
space:
mode:
authorBrandon Westcott <brandon@quorumcontrol.com>2020-03-18 18:19:32 -0400
committerBrandon Westcott <brandon@quorumcontrol.com>2020-03-19 10:16:35 -0400
commit15f517feab93a09f633ea1b6220515adc85fe420 (patch)
tree0d73a8e54cbfbadcfb3dd6f1d1a8e3506ea00bc1 /plumbing/transport/server
parent1dbaf49cde7bc189fb05b875aec535b124d7dc43 (diff)
downloadgo-git-15f517feab93a09f633ea1b6220515adc85fe420.tar.gz
plumbing: transport server check for nil Packfile, fixes ref deletes
Diffstat (limited to 'plumbing/transport/server')
-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)