diff options
Diffstat (limited to 'objects/submodule')
| -rw-r--r-- | objects/submodule/base.py | 10 | ||||
| -rw-r--r-- | objects/submodule/root.py | 3 |
2 files changed, 3 insertions, 10 deletions
diff --git a/objects/submodule/base.py b/objects/submodule/base.py index 4f4223b6..5d32d600 100644 --- a/objects/submodule/base.py +++ b/objects/submodule/base.py @@ -14,6 +14,7 @@ from git.util import ( join_path_native, to_native_path_linux ) + from git.config import SectionConstraint from git.exc import ( InvalidGitRepositoryError, @@ -339,14 +340,7 @@ class Submodule(util.IndexObject, Iterable, Traversable): # have a valid branch, but no checkout - make sure we can figure # that out by marking the commit with a null_sha - # have to write it directly as .commit = NULLSHA tries to resolve the sha - # This will bring the branch into existance - refpath = join_path_native(mrepo.git_dir, local_branch.path) - refdir = os.path.dirname(refpath) - if not os.path.isdir(refdir): - os.makedirs(refdir) - #END handle directory - open(refpath, 'w').write(self.NULL_HEX_SHA) + local_branch.set_object(util.Object(mrepo, self.NULL_BIN_SHA)) # END initial checkout + branch creation # make sure HEAD is not detached diff --git a/objects/submodule/root.py b/objects/submodule/root.py index 2e3cc775..d194cd5b 100644 --- a/objects/submodule/root.py +++ b/objects/submodule/root.py @@ -48,8 +48,7 @@ class RootModule(Submodule): :param previous_commit: If set to a commit'ish, the commit we should use as the previous commit the HEAD pointed to before it was set to the commit it points to now. - If None, it defaults to ORIG_HEAD otherwise, or the parent of the current - commit if it is not given + If None, it defaults to HEAD@{1} otherwise :param recursive: if True, the children of submodules will be updated as well using the same technique :param force_remove: If submodules have been deleted, they will be forcibly removed. |
