Worktree created in home directory instead of ~/.kugetsu-worktrees in v0.2.9 #185

Closed
opened 2026-04-06 06:20:27 +02:00 by shoko · 0 comments
Owner

Bug

In v0.2.9, cmd_start creates worktrees in the daemon's working directory (/home/shoko) instead of ``.

Root cause: kugetsu-session.sh line 249 calls create_worktree without passing the `` argument. In create_worktree() (kugetsu-worktree.sh line 68), parent_dir defaults to /home/shoko:

local parent_dir="${2:-$PWD}"

Since the daemon runs from /home/shoko, worktrees end up at /home/shoko/git.fbrns.co-shoko-kugetsu-158 instead of ~/.kugetsu-worktrees/git.fbrns.co-shoko-kugetsu-158.

Affected versions: v0.2.9

Reproduction

  1. kugetsu queue-daemon start
  2. kugetsu delegate "https://git.fbrns.co/shoko/kugetsu/issues/158"
  3. Worktree created at /home/shoko/git.fbrns.co-shoko-kugetsu-158 instead of ~/.kugetsu-worktrees/

Fix

kugetsu-session.sh line 249:

# WRONG
create_worktree "$issue_ref"

# CORRECT
create_worktree "$issue_ref" "$WORKTREES_DIR"
## Bug In v0.2.9, `cmd_start` creates worktrees in the daemon's working directory (`/home/shoko`) instead of ``. **Root cause:** `kugetsu-session.sh` line 249 calls `create_worktree ` without passing the `` argument. In `create_worktree()` (kugetsu-worktree.sh line 68), `parent_dir` defaults to `/home/shoko`: ```bash local parent_dir="${2:-$PWD}" ``` Since the daemon runs from `/home/shoko`, worktrees end up at `/home/shoko/git.fbrns.co-shoko-kugetsu-158` instead of `~/.kugetsu-worktrees/git.fbrns.co-shoko-kugetsu-158`. **Affected versions:** v0.2.9 ## Reproduction 1. `kugetsu queue-daemon start` 2. `kugetsu delegate "https://git.fbrns.co/shoko/kugetsu/issues/158"` 3. Worktree created at `/home/shoko/git.fbrns.co-shoko-kugetsu-158` instead of `~/.kugetsu-worktrees/` ## Fix `kugetsu-session.sh` line 249: ```bash # WRONG create_worktree "$issue_ref" # CORRECT create_worktree "$issue_ref" "$WORKTREES_DIR" ```
shoko added the bug label 2026-04-06 06:20:27 +02:00
shoko closed this issue 2026-04-06 07:33:04 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/kugetsu#185