diff options
author | Paulo Gomes <pjbgf@linux.com> | 2023-04-11 19:08:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-11 19:08:53 +0100 |
commit | ce62f3e9ff86270538a514a68d3bd5563a733e3b (patch) | |
tree | bf1afc93f0245323589c5f8715718533c794b5b1 /plumbing/format/packfile/parser.go | |
parent | 3f1cfde283c93f33218c807602e93d47f72f7b90 (diff) | |
parent | cdd1e5562d10c6bb19f979ca32f3ae7ef646024f (diff) | |
download | go-git-ce62f3e9ff86270538a514a68d3bd5563a733e3b.tar.gz |
Merge pull request #485 from ZauberNerd/fix-non-external-delta-ref
plumbing: resolve non-external delta references
Diffstat (limited to 'plumbing/format/packfile/parser.go')
-rw-r--r-- | plumbing/format/packfile/parser.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/plumbing/format/packfile/parser.go b/plumbing/format/packfile/parser.go index 522c146..6012b04 100644 --- a/plumbing/format/packfile/parser.go +++ b/plumbing/format/packfile/parser.go @@ -237,6 +237,15 @@ func (p *Parser) indexObjects() error { return err } + // Move children of placeholder parent into actual parent, in case this + // was a non-external delta reference. + if placeholder, ok := p.oiByHash[sha1]; ok { + ota.Children = placeholder.Children + for _, c := range ota.Children { + c.Parent = ota + } + } + ota.SHA1 = sha1 p.oiByHash[ota.SHA1] = ota } |