fixing Git hash computation to work when .git dir missing