diff options
| author | Barry Scott <barry@barrys-emacs.org> | 2016-07-12 18:27:03 +0100 |
|---|---|---|
| committer | Barry Scott <barry@barrys-emacs.org> | 2016-07-12 18:27:03 +0100 |
| commit | b4b5ecc217154405ac0f6221af99a4ab18d067f6 (patch) | |
| tree | 42ec5a4a19a52158c6aa6a20afabd75450f4fbe2 /git/index | |
| parent | a7f403b1e82d4ada20d0e747032c7382e2a6bf63 (diff) | |
| parent | 4896fa2ccbd84553392e2a74af450d807e197783 (diff) | |
| download | GitPython-b4b5ecc217154405ac0f6221af99a4ab18d067f6.tar.gz GitPython-b4b5ecc217154405ac0f6221af99a4ab18d067f6.zip | |
Merge branch 'master' of https://github.com/gitpython-developers/GitPython
Diffstat (limited to 'git/index')
| -rw-r--r-- | git/index/base.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/git/index/base.py b/git/index/base.py index 3e68f843..524b4568 100644 --- a/git/index/base.py +++ b/git/index/base.py @@ -931,19 +931,24 @@ class IndexFile(LazyMixin, diff.Diffable, Serializable): return out def commit(self, message, parent_commits=None, head=True, author=None, - committer=None, author_date=None, commit_date=None): + committer=None, author_date=None, commit_date=None, + skip_hooks=False): """Commit the current default index file, creating a commit object. For more information on the arguments, see tree.commit. :note: If you have manually altered the .entries member of this instance, don't forget to write() your changes to disk beforehand. + Passing skip_hooks=True is the equivalent of using `-n` + or `--no-verify` on the command line. :return: Commit object representing the new commit""" - run_commit_hook('pre-commit', self) + if not skip_hooks: + run_commit_hook('pre-commit', self) tree = self.write_tree() rval = Commit.create_from_tree(self.repo, tree, message, parent_commits, head, author=author, committer=committer, author_date=author_date, commit_date=commit_date) - run_commit_hook('post-commit', self) + if not skip_hooks: + run_commit_hook('post-commit', self) return rval @classmethod |
