workspace: explicit fetch right after bare clone (populates remote-tracking refs that --bare doesn't)

This commit is contained in:
Kayos 2026-04-29 13:58:28 -07:00
parent 129d630391
commit 3578c9321b

View file

@ -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()