Repository navigation
Commit c5904d6
authored
refactor: save a git call when the author is on ignore_authors (#694)
* refactor: save a git call when the author is on ignore_authors
The author checks asked git whether a commit exists before they read
ignore_authors, so an author on the list cost one `git rev-parse` more
than in 2.20.4. Read the list first again, and look the commit up only
when the list said no; a repository with no commits then asks the list
a second time about the identity the first commit will carry.
One test of the fallback to the last commit's author ran that lookup
against the real repository. It now patches it like the other git calls.
* test: pass has_head instead of patching the commit lookup
Patching has_commits in the fallback test built a mock that costs more
than the git call it replaced, by CodSpeed's count. The test now tells
_get_author_value that a commit exists, so nothing is looked up.
---------
Co-authored-by: Xianpeng Shen <[email protected]>1 parent 079bb74 commit c5904d6
2 files changed
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
694 | 694 | | |
695 | 695 | | |
696 | 696 | | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
697 | 700 | | |
698 | 701 | | |
699 | 702 | | |
| |||
702 | 705 | | |
703 | 706 | | |
704 | 707 | | |
705 | | - | |
706 | | - | |
| 708 | + | |
| 709 | + | |
707 | 710 | | |
708 | 711 | | |
709 | 712 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
733 | 733 | | |
734 | 734 | | |
735 | 735 | | |
736 | | - | |
| 736 | + | |
| 737 | + | |
737 | 738 | | |
738 | 739 | | |
739 | 740 | | |
| |||
0 commit comments