diff --git a/src/applications/repository/storage/PhabricatorRepository.php b/src/applications/repository/storage/PhabricatorRepository.php --- a/src/applications/repository/storage/PhabricatorRepository.php +++ b/src/applications/repository/storage/PhabricatorRepository.php @@ -2528,8 +2528,22 @@ private function synchronizeWorkingCopyFromBinding($binding) { $fetch_uri = $this->getClusterRepositoryURIFromBinding($binding); + $local_path = $this->getLocalPath(); if ($this->isGit()) { + if (!Filesystem::pathExists($local_path)) { + $device = AlmanacKeys::getLiveDevice(); + throw new Exception( + pht( + 'Repository "%s" does not have a working copy on this device '. + 'yet, so it can not be synchronized. Wait for the daemons to '. + 'construct one or run `bin/repository update %s` on this host '. + '("%s") to build it explicitly.', + $this->getDisplayName(), + $this->getMonogram(), + $device->getName())); + } + $argv = array( 'fetch --prune -- %s %s', $fetch_uri, @@ -2546,7 +2560,7 @@ ->setProtocol($fetch_uri->getProtocol()) ->newFuture(); - $future->setCWD($this->getLocalPath()); + $future->setCWD($local_path); $future->resolvex(); }