Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try to detect SCM roots a little less strictly
This change was driven by working inside Git submodules. We traverse up into the superproject, and you end up searching a much larger search space than you want. In the case of my dotfiles repo it's even worse, because if I am working in ~/.vim/bundle/command-t, ~/.vim is actually a symlink to ~/code/wincent/.vim; ~/code/wincent/.vim/bundle/command-t is a submodule of ~/code/wincent, and that gets used as the root. So not only am I searching for more than I want (including any open files which will be mirrored as ~/.vim/tmp/swap/some_file.rb.swp etc), the files I am trying to find are also underneath a dot-directory, so I have to prefix my searches with a period to get the files to show up. So, this commit stops traversal at the submodule boundary and doesn't keep going up to the superproject. In submodules .git will still exist but in recent versions it will be a normal file containing a "gitlink"; eg: gitdir: ../../../.git/modules/.vim/bundle/command-t So now we just check for existence rather than directory-ness. This also means that if you want to ever mark a diretory as a traversal boundary you can just `touch .git` (or `touch .hg` etc) in it.
- Loading branch information