Report git errors when checking ancestry

The --is-ancestor option is slightly newish, so better make the error
from git visible.