-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fsmonitor: fix empty path in dirfilter
## Summary Running the ignore matcher on an empty path produces incorrect results. In the rust implementation, this isn't an issue, because there are directory matchers that run on the directory result. In the Python treestate bindings, we don't have that functionality, so it returns an empty string. This makes this logic match the code in `dirstate.py` (line ~925) where we check for path being an empty string. This fixes `sl status` (and related functionality) when fsmonitor is enabled and there's a complex gitignore file that ignores files in the root directory. ## Test Plan Added Mercurial integration test
- Loading branch information
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#require fsmonitor | ||
|
||
$ configure modernclient | ||
$ setconfig status.use-rust=False workingcopy.ruststatus=False | ||
$ newrepo | ||
|
||
Ensure that, when files in the root are ignored and there is an exclusion, that hg status returns the correct value | ||
$ echo -e "/*\n!/foobar" > .gitignore | ||
$ hg status | ||
$ mkdir foobar | ||
$ touch root-file foobar/foo # adds files to root and to foobar | ||
$ hg status | ||
? foobar/foo | ||
$ hg status # run it a second time to ensure that we didn't accidentally exclude the file | ||
? foobar/foo |