Fix incorrect distanceBetween function

jgit-describe is calculating the distance as a number a lot lower than git-describe does.

This merges in the fix from erussell/jgit-describe from 2012...