Set endpath properly

Set endpath to the location it's being called from so we can
check if we're in a git directory or not