Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cmd/bd/daemon_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down