Skip to content

[repo-assist] Fix git dependency restore from a cold git cache - #4463

Draft
github-actions[bot] wants to merge 1 commit into
masterfrom
repo-assist/fix-issue-4461-cold-git-cache-72832df9fc4f3ea6
Draft

github-actions[bot] wants to merge 1 commit into
masterfrom
repo-assist/fix-issue-4461-cold-git-cache-72832df9fc4f3ea6

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Repo Assist here, an automated AI assistant.

Closes #4461

Root cause: since #4407, fetchCache runs inside RunInLockedAccessMode, which creates the cache folder for its lock file. fetchCache then sees the folder, skips git clone --mirror, and runs git remote set-url in a non-repository.

Fix: if the folder exists but has no objects directory, initialise it with git init --bare and git remote add --mirror=fetch origin <url>. The existing remote update --prune then populates it. This follows the approach suggested in the issue. Existing caches are untouched.

Test Status

  • dotnet tool restore and dotnet paket restore --group Main: succeeded
  • dotnet build src/Paket.Core/Paket.Core.fsproj: succeeded, 0 errors
  • Manually ran the init --bare / remote add --mirror=fetch / remote update --prune sequence in a folder containing paket.processlock. It worked, with a small difference: the sandbox's safe.bareRepository=explicit setting blocked the final remote update there.
  • No automated test added: it needs a real git remote. Not run: unit and integration tests.

Generated by 🌈 Repo Assist, see workflow run. Learn more.
Comment /repo-assist to run again

Add this agentic workflow to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@b4e175bab6674279e0fe158f7dc877b77bc9d92f
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

0 participants