Do not fail on empty clone target

This commit is contained in:
2022-06-08 17:05:42 +02:00
parent 62c2fc24cd
commit f89c9c2ca5

View File

@@ -143,7 +143,13 @@ fn sync_repo(root_path: &Path, repo: &repo::Repo, init_worktree: bool) -> Result
let mut newly_created = false; let mut newly_created = false;
if repo_path.exists() { if repo_path.exists()
&& repo_path
.read_dir()
.map_err(|error| error.to_string())?
.next()
.is_some()
{
if repo.worktree_setup && !actual_git_directory.exists() { if repo.worktree_setup && !actual_git_directory.exists() {
return Err(String::from( return Err(String::from(
"Repo already exists, but is not using a worktree setup", "Repo already exists, but is not using a worktree setup",