-
Notifications
You must be signed in to change notification settings - Fork 534
plumbing/object: add WalkCommitHistoryPost func #305
Conversation
As for the test - tried modifying Also don't know how to test this func properly. Ideally, both funcs would have a test that verifies the order is correct. In practice, this test suite is a bit obscure and some pointers on how to do that with this mock git repository/history would be of great help. |
Codecov Report
@@ Coverage Diff @@
## master #305 +/- ##
==========================================
- Coverage 77.36% 77.34% -0.02%
==========================================
Files 117 117
Lines 7995 8011 +16
==========================================
+ Hits 6185 6196 +11
- Misses 1152 1156 +4
- Partials 658 659 +1
Continue to review full report at Codecov.
|
A seen map got rid of the len error, so did that. Perhaps the way to have the tests for the two funcs actually test the order would be to avoid |
@mvdan for testing, you can call to WalkCommitHistoryPost passing a function that adds commit hashes to a slice, then you just check the slice. |
@smola that's what the other test already does (minus the sort). But my question is whether those set of commits contain any merge commits. If they don't, the order obtained from the two functions would be exactly the same and the tests would not be as useful. |
ping @smola |
@mvdan Sorry for the delay! Yes. The |
Awesome thanks - will update the PR with proper tests. |
Also add a test. Make both the pre-order and post-order tests not sort commits, to actually test the order in which the commit history is walked. Fixes #223.
Done, PTAL. |
Thanks @mvdan! |
No description provided.