Description
I see that the server implementation is currently incomplete. Leaving this for a note while experimenting server logics.
What happened
plumbing/transport/server.(*rpSession).ReceivePack()
fails with reference delta not found
if packfile referencing external objects("thin pack") is received.
The referenced object exists on the target repository. Current filesystem/dotgit.(*PackWriter)
implementation blocks finding external references and parsing thin packs.
Why did it happen
ReceivePack()
writes packfile to storage, calling packfile.UpdateObjectStorage()
.
go-git/plumbing/transport/server/server.go
Line 303 in 15aedd2
Then filesystem/dotgit.(*packWriter)
is initiated and parses received packfile on separate goroutine, creating packfile.Parser
with no reference to local storage. This causes packfiles with ExternalRef
to raise ErrReferenceDeltaNotFound
go-git/storage/filesystem/dotgit/writers.go
Lines 53 to 61 in 15aedd2
Temporary workaround
By commenting out following storer.PackfileWriter
code path, the packfile is parsed successfully. The received packfile is unpacked on the fly using the storage s.
go-git/plumbing/format/packfile/common.go
Lines 29 to 34 in 15aedd2