Only update files that have changed in pre commit hook