check for .git/HEAD before reading