public function getGitDirectory(InputInterface $input, OutputInterface $output, $optionDir = null)
    {
        $dir = $optionDir;
        if (!$dir) {
            $dir = $this->getVcsDirectory();
        }
        if (!$dir) {
            $dir = $this->getCommandDir();
        }
        $validator = $this->getValidator();
        try {
            return $validator($dir);
        } catch (\Exception $e) {
        }

        return $this->askProjectDir($input, $output, $dir);
    }