tests: avoid changing the current directory
Mercurial allows specifying which repository to use via the -R/--repository option. Git allows a similar function using the --git-dir option. By using these options, in many cases we can avoid checking the current directory. This makes tests easier to understand, as you don't need to remember which directory you're in to understand what's going on. It also makes tests easier to write, as you don't need to remember to cd out of a directory when you're done doing things there. Thanks to Felipe Contreras for the patch which this was based on.
Showing
- tests/test-clone.t 2 additions, 9 deletionstests/test-clone.t
- tests/test-conflict-1.t 1 addition, 4 deletionstests/test-conflict-1.t
- tests/test-conflict-2.t 1 addition, 4 deletionstests/test-conflict-2.t
- tests/test-convergedmerge.t 1 addition, 4 deletionstests/test-convergedmerge.t
- tests/test-empty-working-tree.t 2 additions, 5 deletionstests/test-empty-working-tree.t
- tests/test-encoding.t 2 additions, 4 deletionstests/test-encoding.t
- tests/test-file-removal.t 2 additions, 4 deletionstests/test-file-removal.t
- tests/test-git-clone.t 2 additions, 3 deletionstests/test-git-clone.t
- tests/test-git-submodules.t 2 additions, 3 deletionstests/test-git-submodules.t
- tests/test-hg-author.t 2 additions, 8 deletionstests/test-hg-author.t
- tests/test-hg-branch.t 1 addition, 4 deletionstests/test-hg-branch.t
- tests/test-hg-tags.t 2 additions, 5 deletionstests/test-hg-tags.t
- tests/test-incoming.t 5 additions, 7 deletionstests/test-incoming.t
- tests/test-merge.t 2 additions, 5 deletionstests/test-merge.t
- tests/test-octopus.t 2 additions, 4 deletionstests/test-octopus.t
- tests/test-pull-after-strip.t 2 additions, 8 deletionstests/test-pull-after-strip.t
- tests/test-tree-decomposition.t 2 additions, 4 deletionstests/test-tree-decomposition.t
Loading
Please register or sign in to comment