//this should be setOption, but it fails with a = between name and value
->addArgument('--separate-git-dir')
->addArgument(
$GLOBALS['phorkie']['cfg']['gitdir'] . '/' . $new->id . '.git'
)
->addArgument($pathOrUrl)
//this should be setOption, but it fails with a = between name and value
->addArgument('--separate-git-dir')
->addArgument(
$GLOBALS['phorkie']['cfg']['gitdir'] . '/' . $new->id . '.git'
)
->addArgument($pathOrUrl)
- ->addArgument($new->workDir)
- ->execute();
+ ->addArgument($new->workDir);
+ try {
+ $cmd->execute();
+ } catch (\Exception $e) {
+ //clean up, we've got no workdir otherwise
+ $new->delete();
+ throw $e;
+ }
+