Skip to content
Snippets Groups Projects
Commit 9c15c890 authored by Sean Farley's avatar Sean Farley
Browse files

gitdirstate: only wrap for hg-git repos

Previously, if a user enables hg-git and in a non-git repo (i.e.
hg-only) they have a .gitignore, then hg-git will try to parse that. I
consider this a bug and a bad performance regression for what should be
a no-op.
parent 1fec6463
No related branches found
No related tags found
No related merge requests found
......@@ -208,7 +208,9 @@
if not isinstance(repo, gitrepo.gitrepo):
if (getattr(dirstate, 'rootcache', False) and
(not ignoremod or getattr(ignore, 'readpats', False))):
(not ignoremod or getattr(ignore, 'readpats', False)) and
hgutil.safehasattr(repo, 'join') and
os.path.exists(repo.join('git'))):
# only install our dirstate wrapper if it has a hope of working
import gitdirstate
if ignoremod:
......
......@@ -5,6 +5,11 @@
$ hg init
We should only read .gitignore files in a hg-git repo (i.e. one with .hg/git
directory) otherwise, a rogue .gitignore could slow down a hg-only repo
$ mkdir .hg/git
$ touch foo
$ touch foobar
$ touch bar
......
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