diff --git a/crafting_table/workspace.py b/crafting_table/workspace.py index 2e310f8..878049c 100644 --- a/crafting_table/workspace.py +++ b/crafting_table/workspace.py @@ -106,6 +106,14 @@ class WorkspaceManager: ["config", "remote.origin.fetch", "+refs/heads/*:refs/remotes/origin/*"], log_fh, cwd=str(paths.cache_dir), ) + # `git clone --bare` populates refs/heads/* but NOT + # refs/remotes/origin/* — we need an explicit fetch to + # materialize the remote-tracking refs the worktree-add + # below will use. + await _git( + ["fetch", "--prune", "origin", "+refs/heads/*:refs/remotes/origin/*"], + log_fh, cwd=str(paths.cache_dir), + ) else: log_fh.write(f"[workspace] fetching latest into {paths.cache_dir}\n") log_fh.flush()