Skip to content

go config: fix symlink resolution in resolveWorkingDir#11

Merged
ChenJesse merged 1 commit intomainfrom
jesse/fix-symlink-working-dir
Mar 12, 2026
Merged

go config: fix symlink resolution in resolveWorkingDir#11
ChenJesse merged 1 commit intomainfrom
jesse/fix-symlink-working-dir

Conversation

@ChenJesse
Copy link
Contributor

Summary

  • Remove filepath.EvalSymlinks from resolveWorkingDir so that the working directory resolves relative to the actual cwd, not the symlink target
  • Fixes fswatch watching the wrong directory when user.taskrunner.json is symlinked from a worktree clone to the primary repo

Context

When running taskrunner from a worktree clone (e.g. app2), the .envrc symlinks user.taskrunner.json back to the primary clone (app). EvalSymlinks followed this symlink, causing filepath.Dir to resolve to the primary clone's directory. This meant fswatch watched /Users/jesse/co/app instead of /Users/jesse/co/app2, so file changes in the worktree never triggered auto-reload.

filepath.Abs alone is sufficient — it gives the correct absolute path relative to the current working directory without following symlinks.

🤖 Generated with Claude Code

When the config file (e.g. user.taskrunner.json) is a symlink,
EvalSymlinks resolves the path to the symlink target's directory
instead of the current working directory. This causes fswatch to
watch the wrong repo in worktree clones.

filepath.Abs alone is sufficient — it resolves relative to cwd
without following symlinks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@ChenJesse ChenJesse merged commit 99034e9 into main Mar 12, 2026
1 check passed
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.

1 participant