diff options
author | Paulo Gomes <pjbgf@linux.com> | 2023-07-01 15:37:24 +0100 |
---|---|---|
committer | Paulo Gomes <pjbgf@linux.com> | 2023-07-01 15:37:24 +0100 |
commit | abe49196b80e367f7cc123a095b32958f8d0470b (patch) | |
tree | 83e0b1ad994b912fe235e8d4ed59a8db0d2675ad /remote.go | |
parent | 35f7e6770361a2c16c9b6c44acdc38ae04c75bd3 (diff) | |
download | go-git-abe49196b80e367f7cc123a095b32958f8d0470b.tar.gz |
plumbing: http, Fix empty repos on Git v2.41+
Git v2.41.0 comes with [changes](https://github.com/git/git/commit/933e3a4ee205353d8f093d5dfcd226fa432c4e58)
that breaks go-git's assumptions for when detecting empty repositories.
Go-git expects a flush instead of the first hash line. Instead, a dummy capabilities^{}
with zero-id is returned. The change aims to allow for identifying
the object format even when cloning empty
repositories.
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
Diffstat (limited to 'remote.go')
-rw-r--r-- | remote.go | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -224,11 +224,13 @@ func (r *Remote) PushContext(ctx context.Context, o *PushOptions) (err error) { return err } - if err = rs.Error(); err != nil { - return err + if rs != nil { + if err = rs.Error(); err != nil { + return err + } } - return r.updateRemoteReferenceStorage(req, rs) + return r.updateRemoteReferenceStorage(req) } func (r *Remote) useRefDeltas(ar *packp.AdvRefs) bool { @@ -347,7 +349,6 @@ func (r *Remote) newReferenceUpdateRequest( func (r *Remote) updateRemoteReferenceStorage( req *packp.ReferenceUpdateRequest, - result *packp.ReportStatus, ) error { for _, spec := range r.c.Fetch { |