Refactoring method for counting commits that include a given file extension