protected function getGitDirectory()
    {
        if ($this->gitDirectory === null) {
            $this->gitDirectory = $this->getWorktreeDirectory() . '/.git';
        }

        return $this->gitDirectory;
    }