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:
🔄 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>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 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:
main← Head:fix/203-bundle-path-nix📝 Commits (3)
dc2eca0fix(nix): ensure absolute bundle path in pre-sync backup (#203)c2887dcfix(nix): ensure absolute bundle path in pre-sync backup (#203)1014e7fci: 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
Unable to create '...bundle.lock': No such file or directoryerrors on NixOS (#203)path.isAbsolute()check with unconditionalpath.resolve()to guaranteebundlePathis always absolute before passing togit -CbackupDirectoryis relativeRoot Cause
git -C mirrorClonePath bundle create bundlePathchanges git's working directory to the temp clone. IfbundlePathis relative, git interprets it relative tomirrorClonePath, producing an invalid concatenated path like:Test plan
git bundle createwhenbackupDirectoryis relativeCloses #203
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.