Skip to content

Remove shallow.lock before running git fetch#414

Merged
edolstra merged 1 commit intomainfrom
eelcodolstra/nix-368
Apr 6, 2026
Merged

Remove shallow.lock before running git fetch#414
edolstra merged 1 commit intomainfrom
eelcodolstra/nix-368

Conversation

@edolstra
Copy link
Copy Markdown
Collaborator

@edolstra edolstra commented Apr 5, 2026

Motivation

An interrupted git fetch can leave behind a shallow.lock file which causes subsequent fetches to fail. Since Nix already has a PathLock on the repo, it should be safe to just delete this file.

Context

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability of git repository fetch operations by adding a cleanup step that removes leftover lock files before fetching, preventing potential failures during repository synchronization.

An interrupted `git fetch` can leave behind a `shallow.lock` file
which causes subsequent fetches to fail. Since Nix already has a
PathLock on the repo, it should be safe to just delete this file.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1b813199-b88a-4504-bb48-333a38150d7a

📥 Commits

Reviewing files that changed from the base of the PR and between 53f56d2 and 3debecd.

📒 Files selected for processing (1)
  • src/libfetchers/git-utils.cc

📝 Walkthrough

Walkthrough

A pre-fetch cleanup step is added to GitRepoImpl::fetch that attempts to delete a leftover shallow.lock file before executing the git fetch command, preventing potential lock-related failures during shallow repository fetches.

Changes

Cohort / File(s) Summary
Git fetch cleanup
src/libfetchers/git-utils.cc
Added pre-fetch deletion of shallow.lock file to clear potential lock-related blocking issues before git fetch execution.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • cole-h

Poem

🐰 A lock file lingered, blocking the way,
So we sweep it away before fetch starts to play,
Git flows faster now, shallow and free,
A cleanup that keeps repositories spree! 🌿

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: removing shallow.lock before running git fetch, which directly corresponds to the implemented solution.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch eelcodolstra/nix-368

Comment @coderabbitai help to get the list of available commands and usage tips.

@edolstra edolstra enabled auto-merge April 5, 2026 10:22
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 5, 2026

@github-actions github-actions bot temporarily deployed to pull request April 5, 2026 10:29 Inactive
@edolstra edolstra added this pull request to the merge queue Apr 6, 2026
Merged via the queue into main with commit 6e20d9e Apr 6, 2026
28 checks passed
@edolstra edolstra deleted the eelcodolstra/nix-368 branch April 6, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants