summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-01-15 19:16:08 +0100
committerSebastian Thiel <byronimo@gmail.com>2015-01-15 19:16:08 +0100
commita9a5414300a245b6e93ea4f39fbca792c3ec753f (patch)
tree234458e9eaa898ee34af64aa33dad26be1c10bf0
parent26fc5866f6ed994f3b9d859a3255b10d04ee653d (diff)
downloadgitpython-a9a5414300a245b6e93ea4f39fbca792c3ec753f.tar.gz
Fixed previously failing test
It actually revealed a bug in the implementation of Submodule.add, which just showed in python 3 for the wrong reasons. Thankfully, failing tests after all allowed to get this issue fixed ... .
-rw-r--r--git/objects/submodule/base.py4
-rw-r--r--git/test/test_submodule.py5
2 files changed, 5 insertions, 4 deletions
diff --git a/git/objects/submodule/base.py b/git/objects/submodule/base.py
index 92b0c8e8..e055cb8c 100644
--- a/git/objects/submodule/base.py
+++ b/git/objects/submodule/base.py
@@ -256,7 +256,7 @@ class Submodule(util.IndexObject, Iterable, Traversable):
# END assure url correctness
# INSTANTIATE INTERMEDIATE SM
- sm = cls(repo, cls.NULL_BIN_SHA, cls.k_default_mode, path, name)
+ sm = cls(repo, cls.NULL_BIN_SHA, cls.k_default_mode, path, name, url='invalid-temporary')
if sm.exists():
# reretrieve submodule from tree
try:
@@ -298,7 +298,7 @@ class Submodule(util.IndexObject, Iterable, Traversable):
if not branch_is_default:
kwargs['b'] = br.name
# END setup checkout-branch
- mrepo = git.Repo.clone_from(url, path, **kwargs)
+ mrepo = git.Repo.clone_from(url, os.path.join(repo.working_tree_dir, path), **kwargs)
# END verify url
# update configuration and index
diff --git a/git/test/test_submodule.py b/git/test/test_submodule.py
index 2be0e795..3e3a97d8 100644
--- a/git/test/test_submodule.py
+++ b/git/test/test_submodule.py
@@ -610,6 +610,7 @@ class TestSubmodule(TestBase):
git.Repo.init(empty_repo_dir)
for checkout_mode in range(2):
- self.failUnlessRaises(ValueError, parent.create_submodule, 'empty', 'empty',
- url=empty_repo_dir, no_checkout=checkout_mode)
+ name = 'empty' + str(checkout_mode)
+ self.failUnlessRaises(ValueError, parent.create_submodule, name, name,
+ url=empty_repo_dir, no_checkout=checkout_mode and True or False)
# end for each checkout mode