src-d / go-git

Project has been moved to: https://github.com/go-git/go-git
https://github.com/go-git/go-git
Apache License 2.0
4.91k stars 541 forks source link

Add -coverpkg to fix test coverage #1205

Closed knqyf263 closed 4 years ago

knqyf263 commented 4 years ago

The test coverage is not collected correctly because -coverpkg is missing. e.g. plumbing/object/commit_walker_file.go is 0% even though the functions in this file are called many times. https://codecov.io/gh/src-d/go-git/tree/master/plumbing/object

plumbing/object/commit_walker_file.go is called in repository_test.go. At this time, if -coverpkg is not specified, the coverage of object package will not be collected.

In addition, after go 1.10, we may be able to use ./... with -cover.