[PR #204] [MERGED] fix(nix): ensure absolute bundle path in pre-sync backup #1331

Closed
opened 2026-04-21 23:17:00 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/RayLabsHQ/gitea-mirror/pull/204
Author: @arunavo4
Created: 3/1/2026
Status: Merged
Merged: 3/1/2026
Merged by: @arunavo4

Base: mainHead: fix/203-bundle-path-nix


📝 Commits (3)

  • dc2eca0 fix(nix): ensure absolute bundle path in pre-sync backup (#203)
  • c2887dc fix(nix): ensure absolute bundle path in pre-sync backup (#203)
  • 1014e7f ci: drop macos matrix and only run nix build on main/tags

📊 Changes

4 files changed (+152 additions, -23 deletions)

View changed files

📝 .github/workflows/nix-build.yml (+2 -4)
📝 package.json (+1 -1)
src/lib/repo-backup.test.ts (+115 -0)
📝 src/lib/repo-backup.ts (+34 -18)

📄 Description

Summary

  • Fixes Unable to create '...bundle.lock': No such file or directory errors on NixOS (#203)
  • Replaced conditional path.isAbsolute() check with unconditional path.resolve() to guarantee bundlePath is always absolute before passing to git -C
  • Added test verifying absolute path is passed to git when backupDirectory is relative

Root Cause

git -C mirrorClonePath bundle create bundlePath changes git's working directory to the temp clone. If bundlePath is relative, git interprets it relative to mirrorClonePath, producing an invalid concatenated path like:

/tmp/gitea-mirror-backup-xxx/repo.git/data/repo-backups/userId/owner/repo/timestamp.bundle.lock

Test plan

  • Existing tests pass (124 pass, 0 fail)
  • New test verifies absolute path is passed to git bundle create when backupDirectory is relative

Closes #203

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/RayLabsHQ/gitea-mirror/pull/204 **Author:** [@arunavo4](https://github.com/arunavo4) **Created:** 3/1/2026 **Status:** ✅ Merged **Merged:** 3/1/2026 **Merged by:** [@arunavo4](https://github.com/arunavo4) **Base:** `main` ← **Head:** `fix/203-bundle-path-nix` --- ### 📝 Commits (3) - [`dc2eca0`](https://github.com/RayLabsHQ/gitea-mirror/commit/dc2eca07ddd1752be48445b94f32e4bd837833da) fix(nix): ensure absolute bundle path in pre-sync backup (#203) - [`c2887dc`](https://github.com/RayLabsHQ/gitea-mirror/commit/c2887dc146ba0d721e219f28f3b2eccca435903d) fix(nix): ensure absolute bundle path in pre-sync backup (#203) - [`1014e7f`](https://github.com/RayLabsHQ/gitea-mirror/commit/1014e7f350da4285fd0169a1b61ae7fe7503a9ce) ci: drop macos matrix and only run nix build on main/tags ### 📊 Changes **4 files changed** (+152 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/nix-build.yml` (+2 -4) 📝 `package.json` (+1 -1) ➕ `src/lib/repo-backup.test.ts` (+115 -0) 📝 `src/lib/repo-backup.ts` (+34 -18) </details> ### 📄 Description ## Summary - Fixes `Unable to create '...bundle.lock': No such file or directory` errors on NixOS (#203) - Replaced conditional `path.isAbsolute()` check with unconditional `path.resolve()` to guarantee `bundlePath` is always absolute before passing to `git -C` - Added test verifying absolute path is passed to git when `backupDirectory` is relative ## Root Cause `git -C mirrorClonePath bundle create bundlePath` changes git's working directory to the temp clone. If `bundlePath` is relative, git interprets it relative to `mirrorClonePath`, producing an invalid concatenated path like: ``` /tmp/gitea-mirror-backup-xxx/repo.git/data/repo-backups/userId/owner/repo/timestamp.bundle.lock ``` ## Test plan - [x] Existing tests pass (124 pass, 0 fail) - [x] New test verifies absolute path is passed to `git bundle create` when `backupDirectory` is relative Closes #203 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-21 23:17:00 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea-mirror#1331