Improve readability/performance of parse_git_dirty function

This is more readable with the bonus of being at least a little faster. On my repos there was 002 time difference, but every millisecond helps. I also had some trees which were clean show up as dirty with the old function, but can't remember the specifics.

This is my fix which is more readable to me and faster according to these benchmarks:

https://gist.github.com/3898739

I couldn't quickly implement the other faster alternatives and found the solution I implemented (pasted) was the most readable solution of them all anyway.