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

Commit

Permalink
Remove debug print, fix large edge count calculation to make the reen…
Browse files Browse the repository at this point in the history
…coded file binary identical
  • Loading branch information
filipnavara committed Apr 23, 2019
1 parent 2a966a4 commit c315339
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions plumbing/format/commitgraph/commitgraph_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package commitgraph_test

import (
"fmt"
"io/ioutil"
"os"
"path"
Expand Down Expand Up @@ -95,7 +94,6 @@ func (s *CommitgraphSuite) TestReencode(c *C) {
writer, err := ioutil.TempFile(dotgit.Root(), "commit-graph")
c.Assert(err, IsNil)
tmpName := writer.Name()
fmt.Printf(tmpName)
defer os.Remove(tmpName)
encoder := commitgraph.NewEncoder(writer)
err = encoder.Encode(index)
Expand Down
2 changes: 1 addition & 1 deletion plumbing/format/commitgraph/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit c315339

Please sign in to comment.