aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/packfile/delta_selector.go
diff options
context:
space:
mode:
authorJavi Fontan <jfontan@gmail.com>2018-01-24 18:32:16 +0100
committerJavi Fontan <jfontan@gmail.com>2018-01-24 18:38:59 +0100
commit522327b572276fe94e76ff9bb5e41b1efdf69dee (patch)
treeed78c69b60e9c6cfb939a712077bd6f32776870c /plumbing/format/packfile/delta_selector.go
parent834cd6f46fa3a3f2b5423f717cc72769e27c915b (diff)
downloadgo-git-522327b572276fe94e76ff9bb5e41b1efdf69dee.tar.gz
plumbing: format/packfile, fix crash with cycle deltas
Resolving cycles relied on ObjectToPack objects having Original. This is no longer true with the changes from #720. This commit changes: * Save original type, hash and size in ObjectToPack * Use SetObject to set both Original and resolved type, hash and size * Restore original object before using BackToOriginal (cycle resolution) * Update encoder test to check this case Signed-off-by: Javi Fontan <jfontan@gmail.com>
Diffstat (limited to 'plumbing/format/packfile/delta_selector.go')
-rw-r--r--plumbing/format/packfile/delta_selector.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/plumbing/format/packfile/delta_selector.go b/plumbing/format/packfile/delta_selector.go
index cd38c16..1d9fb5f 100644
--- a/plumbing/format/packfile/delta_selector.go
+++ b/plumbing/format/packfile/delta_selector.go
@@ -196,7 +196,8 @@ func (dw *deltaSelector) restoreOriginal(otp *ObjectToPack) error {
return err
}
- otp.Original = obj
+ otp.SetOriginal(obj)
+
return nil
}