# fs: Replace \`GlobalWatcher\` with an \`OsWatcher\` that contains one backend \(\#63898\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 6f73c7d0a4aae8e32afb5d01b0fcb89e5e3642ff

Requested commit: 6f73c7d0a4aae8e32afb5d01b0fcb89e5e3642ff

Commit: 6f73c7d0a4aae8e32afb5d01b0fcb89e5e3642ff

Tree: 55bbb0ac17c554f976dd667372b96542eaf9e2ed

Author: Cole Miller

Committer: GitHub

## Message

```
fs: Replace `GlobalWatcher` with an `OsWatcher` that contains one backend (#63898)

Before, `GlobalWatcher` held a native backend and a polling backend, and
its methods dispatched to one or the other.

After this PR, we have `OsWatcher` which wraps a single watch backend,
and `RealFs` and `FakeFs` hold a native `OsWatcher` and a polling
`OsWatcher`.

This moves the split closer to the place where we decide which backend
should be used, and lets us clean up some indirection. A nice bonus is
that the "is this backend recursive" data exists in exactly one place.

Release Notes:
- N/A
```

## Parents

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

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