Fixed an incorrect check in commit traverser and added a unit test to cover the case.

Fixes #389
Merge pull request #396 from jdgarrett/commit-traverser-fix

Fixed an incorrect check in commit traverser.