Resolve worktree .git files to repository .git directory by jkylling · Pull Request #642 · git-commit-id/git-commit-id-maven-plugin

I took a quick read through the Details section for git-worktree and the worktree-related stuff in gitrepository-layout. It seems like this should work if we assume the GIT_DIR and GIT_COMMON_DIR environment variables aren't set. Not sure if we should consider them here?

There is also the potential situation where .git is a text file containing a gitpath spec, instead of a directory. Also not sure if git-commit-id handles this situation generally; if so, should we also handle that here?