Support absoulte path in git submodule gitdirs

When using git submodules, some versions of git (e.g., 1.7.9) use
abosulate path in the gitdir reference of the submodules. This patch
adds support to handle absoluate path correctly.