diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -700,7 +700,7 @@ class dirstate(object): 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: diff --git a/tests/test-hgignore.t b/tests/test-hgignore.t --- a/tests/test-hgignore.t +++ b/tests/test-hgignore.t @@ -124,3 +124,13 @@ Check it does not ignore the current dir (?:(?:|.*/)[^/]*(?:/|$)) $ cd .. + +Check patterns that match only the directory + + $ echo "^dir\$" > .hgignore + $ hg status + A dir/b.o + ? .hgignore + ? a.c + ? a.o + ? syntax