Mercurial > hg > hg-git
diff tests/test-git-clone.t @ 578:935c4fb1bbfc
tests: let git init create directories when applicable
It's functionally equivalent to create a directory, cd into it, git init, and
cd out of the directory, or simply git init with the directory specified.
In several cases, we were doing the former without performing any other
operations in the git repo, which just made the test unneccesarily complex.
Even in the case where we still want to cd into the directory, calling git
init with the directory name eliminates the need for a separate mkdir command.
This changeset converts the former approach to the latter with the goal of
increasing the readability of the tests.
Thanks to Felipe Contreras for the patch which this was based on.
author | David M. Carr <david@carrclan.us> |
---|---|
date | Wed, 31 Oct 2012 00:01:03 -0400 (2012-10-31) |
parents | c4849b2dab87 |
children | 675f19af79ca |
line wrap: on
line diff
--- a/tests/test-git-clone.t +++ b/tests/test-git-clone.t @@ -7,10 +7,9 @@ bail if the user does not have dulwich $ python -c 'import dulwich, dulwich.repo' || exit 80 - $ mkdir gitrepo + $ git init gitrepo + Initialized empty Git repository in $TESTTMP/gitrepo/.git/ $ cd gitrepo - $ git init - Initialized empty Git repository in $TESTTMP/gitrepo/.git/ $ echo alpha > alpha $ git add alpha $ fn_git_commit -m 'add alpha'