Skip to content
Snippets Groups Projects
Commit f4930b53 authored by Durham Goode's avatar Durham Goode
Browse files

hgignore: fix regression with hgignore directory matches (issue3921)

If a directory matched a regex in hgignore but the files inside the directory
did not match the regex, they would appear as deleted in hg status. This
change fixes them to appear normally in hg status.

Removing the ignore(nf) conditional here is ok because it just means we might
stat more files than we had before. My testing on a large repo shows this
causes no performance regression since the only additional files being stat'd
are the ones that are missing (i.e. status=!), which are generally rare.
parent a6542a67
No related branches found
No related tags found
No related merge requests found
......@@ -700,7 +700,7 @@
for nf in iter(visit):
# Report ignored items in the dmap as long as they are not
# under a symlink directory.
if ignore(nf) and audit_path.check(nf):
if audit_path.check(nf):
try:
results[nf] = lstat(join(nf))
except OSError:
......
......@@ -124,3 +124,13 @@
(?:(?:|.*/)[^/]*(?:/|$))
$ cd ..
Check patterns that match only the directory
$ echo "^dir\$" > .hgignore
$ hg status
A dir/b.o
? .hgignore
? a.c
? a.o
? syntax
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment