check: Only track data blobs when unused blobs should be reported

This improves the memory usage of check a lot as it now only has to
track tree blobs when run using the default parameters.
This commit is contained in:
Michael Eischer
2020-11-15 18:43:07 +01:00
parent 6da66c15d8
commit 1f43cac12d
5 changed files with 34 additions and 25 deletions
+1 -1
View File
@@ -193,7 +193,7 @@ func runCheck(opts CheckOptions, gopts GlobalOptions, args []string) error {
}
}
chkr := checker.New(repo)
chkr := checker.New(repo, opts.CheckUnused)
Verbosef("load indexes\n")
hints, errs := chkr.LoadIndex(gopts.ctx)