e62814b4b0
The status-line branch watcher bound fs.watch to the .git/HEAD file. git updates HEAD via a lock file plus an atomic rename (HEAD.lock -> HEAD), which unlinks the watched inode, so the watch fired for the first branch switch and then died on the stale inode. The displayed branch froze on the previous branch while later switches went unseen. Watch the git directory instead of the HEAD file (and, for reftable repos, the reftable dir as before) and filter directory events for the HEAD entry. The directory inode is stable across renames, so the watch survives every switch. Fixes #8412