Skip to content

Commit

Permalink
Fixed submodule tests to go with either the old or the new version of…
Browse files Browse the repository at this point in the history
… gitdb
  • Loading branch information
Byron committed Jun 10, 2011
1 parent 8828ced commit 4a8bdce
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
7 changes: 3 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[submodule "gitdb"]
path = git/ext/gitdb
url = git://github.com/gitpython-developers/gitdb.git
branch = master
[submodule "gitdb"]
path = git/ext/gitdb
url = git://github.com/gitpython-developers/gitdb.git
2 changes: 1 addition & 1 deletion git/ext/gitdb
11 changes: 6 additions & 5 deletions git/test/test_submodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,11 @@ def _do_base_tests(self, rwrepo):
self.failUnlessRaises(InvalidGitRepositoryError, sm.remove)

# forcibly delete the child repository
prev_count = len(sm.children())
assert csm.remove(force=True) is csm
assert not csm.exists()
assert not csm.module_exists()
assert len(sm.children()) == 0
assert len(sm.children()) == prev_count - 1
# now we have a changed index, as configuration was altered.
# fix this
sm.module().index.reset(working_tree=True)
Expand Down Expand Up @@ -389,7 +390,7 @@ def test_root_module(self, rwrepo):

# deep traversal gitdb / async
rsmsp = [sm.path for sm in rm.traverse()]
assert len(rsmsp) == 2 # gitdb and async, async being a child of gitdb
assert len(rsmsp) >= 2 # gitdb and async [and smmap], async being a child of gitdb

# cannot set the parent commit as root module's path didn't exist
self.failUnlessRaises(ValueError, rm.set_parent_commit, 'HEAD')
Expand Down Expand Up @@ -538,13 +539,13 @@ def test_root_module(self, rwrepo):
# =================
# finally we recursively update a module, just to run the code at least once
# remove the module so that it has more work
assert len(nsm.children()) == 1
assert nsm.exists() and nsm.module_exists() and len(nsm.children()) == 1
assert len(nsm.children()) >= 1 # could include smmap
assert nsm.exists() and nsm.module_exists() and len(nsm.children()) >= 1
# assure we pull locally only
nsmc = nsm.children()[0]
nsmc.config_writer().set_value('url', async_url)
rm.update(recursive=True, progress=prog, dry_run=True) # just to run the code
rm.update(recursive=True, progress=prog)

assert len(nsm.children()) == 1 and nsmc.module_exists()
assert len(nsm.children()) >= 2 and nsmc.module_exists()

0 comments on commit 4a8bdce

Please sign in to comment.