Improved git dirty status algorithm