summaryrefslogtreecommitdiff
path: root/test/git/test_submodule.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-11-20 20:16:31 +0100
committerSebastian Thiel <byronimo@gmail.com>2010-11-20 20:16:31 +0100
commit8e0e315a371cdfc80993a1532f938d56ed7acee4 (patch)
tree327f4d302ecfb05b390e268fd6b912a1da9d6683 /test/git/test_submodule.py
parent8d0aa1ef19e2c3babee458bd4504820f415148e0 (diff)
downloadgitpython-8e0e315a371cdfc80993a1532f938d56ed7acee4.tar.gz
submodule: Fixed capital error when handling the submodule's branch, which was returned in the submodules super repository, not in the submodule's module
Diffstat (limited to 'test/git/test_submodule.py')
-rw-r--r--test/git/test_submodule.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/test/git/test_submodule.py b/test/git/test_submodule.py
index e2261d65..2ef45862 100644
--- a/test/git/test_submodule.py
+++ b/test/git/test_submodule.py
@@ -35,10 +35,19 @@ class TestSubmodule(TestBase):
assert sm.path == 'lib/git/ext/gitdb'
assert sm.path != sm.name # in our case, we have ids there, which don't equal the path
assert sm.url == 'git://gitorious.org/git-python/gitdb.git'
- assert sm.branch.name == 'master' # its unset in this case
+ assert sm.branch_path == 'refs/heads/master' # the default ...
+ assert sm.branch_name == 'master'
assert sm.parent_commit == rwrepo.head.commit
# size is always 0
assert sm.size == 0
+ # the module is not checked-out yet
+ self.failUnlessRaises(InvalidGitRepositoryError, sm.module)
+
+ # which is why we can't get the branch either - it points into the module() repository
+ self.failUnlessRaises(InvalidGitRepositoryError, getattr, sm, 'branch')
+
+ # branch_path works, as its just a string
+ assert isinstance(sm.branch_path, basestring)
# some commits earlier we still have a submodule, but its at a different commit
smold = Submodule.iter_items(rwrepo, self.k_subm_changed).next()
@@ -455,7 +464,7 @@ class TestSubmodule(TestBase):
nsmm = nsm.module()
prev_commit = nsmm.head.commit
for branch in ("some_virtual_branch", cur_branch.name):
- nsm.config_writer().set_value(Submodule.k_head_option, branch)
+ nsm.config_writer().set_value(Submodule.k_head_option, git.Head.to_full_path(branch))
csmbranchchange = rwrepo.index.commit("changed branch to %s" % branch)
nsm.set_parent_commit(csmbranchchange)
# END for each branch to change