Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit ab5b89c

Browse files
committed
Remove debug print, fix large edge count calculation to make the reencoded file binary identical
Signed-off-by: Filip Navara <[email protected]>
1 parent 5630ac1 commit ab5b89c

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

plumbing/format/commitgraph/commitgraph_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package commitgraph_test
22

33
import (
4-
"fmt"
54
"io/ioutil"
65
"os"
76
"path"
@@ -95,7 +94,6 @@ func (s *CommitgraphSuite) TestReencode(c *C) {
9594
writer, err := ioutil.TempFile(dotgit.Root(), "commit-graph")
9695
c.Assert(err, IsNil)
9796
tmpName := writer.Name()
98-
fmt.Printf(tmpName)
9997
defer os.Remove(tmpName)
10098
encoder := commitgraph.NewEncoder(writer)
10199
err = encoder.Encode(index)

plumbing/format/commitgraph/encoder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func (e *Encoder) prepare(idx Index, hashes []plumbing.Hash) (hashToIndex map[pl
8080
for i := 0; i < len(hashes); i++ {
8181
v, _ := idx.GetNodeByIndex(i)
8282
if len(v.ParentHashes) > 2 {
83-
largeEdgesCount += uint32(len(v.ParentHashes) - 2)
83+
largeEdgesCount += uint32(len(v.ParentHashes) - 1)
8484
break
8585
}
8686
}

0 commit comments

Comments
 (0)