Better detection of conflicts

Via. http://stackoverflow.com/questions/3258243/git-check-if-pull-needed/3278427#3278427