diff options
Diffstat (limited to 'git/objects')
-rw-r--r-- | git/objects/base.py | 2 | ||||
-rw-r--r-- | git/objects/commit.py | 9 | ||||
-rw-r--r-- | git/objects/submodule/base.py | 2 |
3 files changed, 10 insertions, 3 deletions
diff --git a/git/objects/base.py b/git/objects/base.py index 42876fc8..77d0ed63 100644 --- a/git/objects/base.py +++ b/git/objects/base.py @@ -135,7 +135,7 @@ class IndexObject(Object): :param repo: is the Repo we are located in :param binsha: 20 byte sha1 - :param mode: + :param mode: is the stat compatible file mode as int, use the stat module to evaluate the infomration :param path: diff --git a/git/objects/commit.py b/git/objects/commit.py index f2ce91ca..b9718694 100644 --- a/git/objects/commit.py +++ b/git/objects/commit.py @@ -69,6 +69,7 @@ class Commit(base.Object, Iterable, Diffable, Traversable, Serializable): message=None, parents=None, encoding=None, gpgsig=None): """Instantiate a new Commit. All keyword arguments taking None as default will be implicitly set on first query. + :param binsha: 20 byte sha1 :param parents: tuple( Commit, ... ) is a tuple of commit ids or actual Commits @@ -97,7 +98,8 @@ class Commit(base.Object, Iterable, Diffable, Traversable, Serializable): dependency graph :return: git.Commit - :note: Timezone information is in the same format and in the same sign + :note: + Timezone information is in the same format and in the same sign as what time.altzone returns. The sign is inverted compared to git's UTC timezone.""" super(Commit, self).__init__(repo, binsha) @@ -296,6 +298,11 @@ class Commit(base.Object, Iterable, Diffable, Traversable, Serializable): # empty repositories have no head commit parent_commits = list() # END handle parent commits + else: + for p in parent_commits: + if not isinstance(p, cls): + raise ValueError("Parent commit '%r' must be of type %s" % (p, cls)) + # end check parent commit types # END if parent commits are unset # retrieve all additional information, create a commit object, and diff --git a/git/objects/submodule/base.py b/git/objects/submodule/base.py index ebb66495..cd7d4ec4 100644 --- a/git/objects/submodule/base.py +++ b/git/objects/submodule/base.py @@ -781,7 +781,7 @@ class Submodule(util.IndexObject, Iterable, Traversable): csm.remove(module, force, configuration, dry_run) del(csm) # end - if not dry_run and nc > 0: + if configuration and not dry_run and nc > 0: # Assure we don't leave the parent repository in a dirty state, and commit our changes # It's important for recursive, unforced, deletions to work as expected self.module().index.commit("Removed submodule '%s'" % self.name) |