Function to check for no of commits