public function fetchHeadCommitHash () : ?string
    {
        if (!\is_dir("{$this->projectDir}/.git"))
        {
            return null;
        }

        $git = $this->run('command -v git');

        return null !== $git
            ? $this->run("{$git} rev-parse HEAD")
            : null;
    }