Speed up Git dirty check.
Do not modify files if not needed.