# worktree: Watch \.git/refs subdirectories for external ref updates \(\#60660\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/2b9b3c7ea21293c9f271d993503e6d8dba2c6891)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 2b9b3c7ea21293c9f271d993503e6d8dba2c6891

Requested commit: 2b9b3c7ea21293c9f271d993503e6d8dba2c6891

Commit: 2b9b3c7ea21293c9f271d993503e6d8dba2c6891

Tree: f2500d3ea5bedaae4eb57b67420506a1ffdba494

Author: Lukas Wirth

Committer: GitHub

## Message

```
worktree: Watch .git/refs subdirectories for external ref updates (#60660)

On Linux and FreeBSD the native file watcher is non-recursive, so a
watch on the .git directory itself does not report changes to files
nested below it. Loose refs live in nested directories under refs, so
external git commit, fetch, branch, and update-ref operations that don't
also touch a direct child of .git (like the index) went entirely
unnoticed.

Watch every directory in the refs tree when a repository is inserted,
and watch directories subsequently created under refs (new remotes,
slash-named branches) as their creation events arrive. On platforms with
recursive watchers these registrations dedupe against the existing
recursive watch, making them free.


---

Release Notes:

- N/A or Added/Fixed/Improved ...
```

## Parents

- [01f915d6be2b7fff98ba21a62e7e7181a2758f57](https://git.cafe/gitcafe/zed/commit/01f915d6be2b7fff98ba21a62e7e7181a2758f57?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/2b9b3c7ea21293c9f271d993503e6d8dba2c6891?format=markdown)
