public function createArchive()
    {
        if ($this->hasHead()) {
            $command = 'git archive -o ' . $this->getFilename() . ' HEAD 2>&1';
            exec($command, $output, $returnValue);

            return $returnValue === 0;
        }

        throw new GitHeadNotAvailable('No Git HEAD present to create an archive from.');
    }