Implemented tests for getting commits and fixed code to make the tests comply