aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/packfile/parser.go
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/format/packfile/parser.go')
-rw-r--r--plumbing/format/packfile/parser.go9
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
}