diff --git a/cmd/bd/daemon_watcher.go b/cmd/bd/daemon_watcher.go index 848d0414..c42b2dae 100644 --- a/cmd/bd/daemon_watcher.go +++ b/cmd/bd/daemon_watcher.go @@ -210,7 +210,8 @@ func (fw *FileWatcher) Start(ctx context.Context, log daemonLogger) { } // Handle git ref changes (only events under gitRefsPath) - if event.Op&fsnotify.Write != 0 && strings.HasPrefix(event.Name, fw.gitRefsPath) { + // Fix: check gitRefsPath is not empty, otherwise HasPrefix("any", "") is always true + if fw.gitRefsPath != "" && event.Op&fsnotify.Write != 0 && strings.HasPrefix(event.Name, fw.gitRefsPath) { if fw.shouldLogGitRefChange() { log.log("Git ref change detected: %s", event.Name) }