Cleaning up logic around currentCommit variable