Simplified the commit number test logic