Description
The worktree() function in src/main.zig performs a multi-step setup:
grab.clone() -- creates a bare clone directory
grab.linkGit() -- creates a .git file
grab.setupOrigin() -- configures the remote
grab.fetchOrigin() -- fetches from origin
If step 1 succeeds but any subsequent step fails, the function returns an error and the caller moves on to the next repo. The bare clone directory is left on disk in a half-configured state.
On a subsequent run, grab.clone() will return error.exists ("path not empty") and the repo can never be successfully set up without manual cleanup by the user.
Expected Behavior
Either:
- Clean up the partially-created directory on failure (rollback), or
- Detect the partial state on subsequent runs and resume setup from where it left off, or
- At minimum, log a warning telling the user that manual cleanup may be needed at the specific path
Related Issues
Description
The
worktree()function insrc/main.zigperforms a multi-step setup:grab.clone()-- creates a bare clone directorygrab.linkGit()-- creates a.gitfilegrab.setupOrigin()-- configures the remotegrab.fetchOrigin()-- fetches from originIf step 1 succeeds but any subsequent step fails, the function returns an error and the caller moves on to the next repo. The bare clone directory is left on disk in a half-configured state.
On a subsequent run,
grab.clone()will returnerror.exists("path not empty") and the repo can never be successfully set up without manual cleanup by the user.Expected Behavior
Either:
Related Issues