Fix bd-73: Add git worktree detection and warnings
- Implement robust worktree detection using git-dir vs git-common-dir comparison - Add prominent warning when daemon mode is active in a worktree - Warn in 3 places: initial connection, auto-start, and daemon start command - Show shared database path and clarify BEADS_AUTO_START_DAEMON behavior - Document limitations and solutions in README.md and AGENTS.md - Add comprehensive tests for detection and path truncation Fixes #55 Amp-Thread-ID: https://ampcode.com/threads/T-254eb9e3-1a42-42d7-afdf-b7ca2d2dcb8b Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -117,6 +117,19 @@ Use --health to check daemon health and metrics.`,
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// Warn if starting daemon in a git worktree
|
||||
if !global {
|
||||
// Ensure dbPath is set for warning
|
||||
if dbPath == "" {
|
||||
if foundDB := beads.FindDatabasePath(); foundDB != "" {
|
||||
dbPath = foundDB
|
||||
}
|
||||
}
|
||||
if dbPath != "" {
|
||||
warnWorktreeDaemon(dbPath)
|
||||
}
|
||||
}
|
||||
|
||||
// Start daemon
|
||||
scope := "local"
|
||||
if global {
|
||||
|
||||
Reference in New Issue
Block a user