aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/commitgraph/encoder.go
diff options
context:
space:
mode:
authorFilip Navara <filip.navara@gmail.com>2019-04-23 15:20:32 +0200
committerFilip Navara <filip.navara@gmail.com>2019-04-24 09:40:06 +0200
commitab5b89c4d4ba616ff125c3d489c1e5881c2dd14b (patch)
tree4a48521e821260f0478d1e33a65dbdf683c68c81 /plumbing/format/commitgraph/encoder.go
parent5630ac19fc41ba608700981531f941137a17c612 (diff)
downloadgo-git-ab5b89c4d4ba616ff125c3d489c1e5881c2dd14b.tar.gz
Remove debug print, fix large edge count calculation to make the reencoded file binary identical
Signed-off-by: Filip Navara <filip.navara@gmail.com>
Diffstat (limited to 'plumbing/format/commitgraph/encoder.go')
-rw-r--r--plumbing/format/commitgraph/encoder.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/plumbing/format/commitgraph/encoder.go b/plumbing/format/commitgraph/encoder.go
index b4a6978..501b09e 100644
--- a/plumbing/format/commitgraph/encoder.go
+++ b/plumbing/format/commitgraph/encoder.go
@@ -80,7 +80,7 @@ func (e *Encoder) prepare(idx Index, hashes []plumbing.Hash) (hashToIndex map[pl
for i := 0; i < len(hashes); i++ {
v, _ := idx.GetNodeByIndex(i)
if len(v.ParentHashes) > 2 {
- largeEdgesCount += uint32(len(v.ParentHashes) - 2)
+ largeEdgesCount += uint32(len(v.ParentHashes) - 1)
break
}
}