aboutsummaryrefslogtreecommitdiff
path: root/git/objects/submodule
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2011-06-13 17:03:47 +0200
committerSebastian Thiel <byronimo@gmail.com>2011-06-13 17:03:47 +0200
commite00bf792077d59b3344f0d14f3192806c42d54bd (patch)
tree659616b6680908f6a7e11ef0283a3b6e4d65bc1a /git/objects/submodule
parent7076f43567df4cd9531a771bff6c9b3ecd313252 (diff)
downloadGitPython-e00bf792077d59b3344f0d14f3192806c42d54bd.tar.gz
GitPython-e00bf792077d59b3344f0d14f3192806c42d54bd.zip
root submodule: Added parent_commit parameter for convenience. Fixed submodule tests to run
Diffstat (limited to 'git/objects/submodule')
-rw-r--r--git/objects/submodule/base.py2
-rw-r--r--git/objects/submodule/root.py5
2 files changed, 3 insertions, 4 deletions
diff --git a/git/objects/submodule/base.py b/git/objects/submodule/base.py
index 0fdb121d..a33dd8ad 100644
--- a/git/objects/submodule/base.py
+++ b/git/objects/submodule/base.py
@@ -89,7 +89,7 @@ class Submodule(util.IndexObject, Iterable, Traversable, RepoAliasMixin):
:param repo: Our parent repository
:param binsha: binary sha referring to a commit in the remote repository, see url parameter
- :param parent_commit: see set_parent_commit()
+ :param parent_commit: a Commit object instance, see set_parent_commit() for more information
:param url: The url to the remote repository which is the submodule
:param branch_path: full (relative) path to ref to checkout when cloning the remote repository"""
super(Submodule, self).__init__(repo, binsha, mode, path)
diff --git a/git/objects/submodule/root.py b/git/objects/submodule/root.py
index 5e4cad2d..6917045a 100644
--- a/git/objects/submodule/root.py
+++ b/git/objects/submodule/root.py
@@ -37,15 +37,14 @@ class RootModule(Submodule):
k_root_name = '__ROOT__'
- def __init__(self, repo):
- # repo, binsha, mode=None, path=None, name = None, parent_commit=None, url=None, ref=None)
+ def __init__(self, repo, parent_commit = None):
super(RootModule, self).__init__(
repo,
binsha = self.NULL_BIN_SHA,
mode = self.k_default_mode,
path = '',
name = self.k_root_name,
- parent_commit = repo.head.commit,
+ parent_commit = parent_commit or repo.head.commit,
url = '',
branch_path = git.Head.to_full_path(self.k_head_default)
)