[cli] fix 'dirty_state?' to work with git older than 1.8