Browse Source

fixes #8179

Rob Bast 5 years ago
parent
commit
7399638e43
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/Composer/Repository/Vcs/HgDriver.php

+ 3 - 2
src/Composer/Repository/Vcs/HgDriver.php

@@ -61,8 +61,9 @@ class HgDriver extends VcsDriver
                 // clean up directory and do a fresh clone into it
                 $fs->removeDirectory($this->repoDir);
 
-                $command = function ($url) {
-                    return sprintf('hg clone --noupdate %s %s', ProcessExecutor::escape($url), ProcessExecutor::escape($this->repoDir));
+                $repoDir = $this->repoDir;
+                $command = function ($url) use ($repoDir) {
+                    return sprintf('hg clone --noupdate %s %s', ProcessExecutor::escape($url), ProcessExecutor::escape($repoDir));
                 };
 
                 $hgUtils->runCommand($command, $this->url, $this->repoDir);