aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/revlist
diff options
context:
space:
mode:
authorJeremy Stribling <strib@alum.mit.edu>2017-09-08 17:51:38 -0700
committerJeremy Stribling <strib@alum.mit.edu>2017-09-09 12:00:17 -0700
commit841b62a321b3739381b48aeea7364126d1c54520 (patch)
tree6d09c53325a7c31e15aa794631ec41c0b36b038c /plumbing/revlist
parentbb3217ce5d5ed682a5c830c40ea031d3c92a8a7e (diff)
downloadgo-git-841b62a321b3739381b48aeea7364126d1c54520.tar.gz
plumbing: the commit walker can skip externally-seen commits
When the revlist is computing the set of hashes needed to transfer, it doesn't need to walk over commits it has already processed. So, it can instruct the commit walker not to walk those commits by passing in its own `seen` map. For a 36K object repo, this brought the time for `revlist.Objects` down from 50s to 30s.
Diffstat (limited to 'plumbing/revlist')
-rw-r--r--plumbing/revlist/revlist.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/plumbing/revlist/revlist.go b/plumbing/revlist/revlist.go
index 10a5813..009fc93 100644
--- a/plumbing/revlist/revlist.go
+++ b/plumbing/revlist/revlist.go
@@ -108,7 +108,7 @@ func reachableObjects(
ignore []plumbing.Hash,
cb func(h plumbing.Hash),
) error {
- i := object.NewCommitPreorderIter(commit, ignore)
+ i := object.NewCommitPreorderIter(commit, seen, ignore)
for {
commit, err := i.Next()
if err == io.EOF {