summaryrefslogtreecommitdiff
path: root/git/index/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'git/index/base.py')
-rw-r--r--git/index/base.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/git/index/base.py b/git/index/base.py
index db0c3cda..7002385c 100644
--- a/git/index/base.py
+++ b/git/index/base.py
@@ -63,7 +63,8 @@ from .fun import (
aggressive_tree_merge,
write_tree_from_cache,
stat_mode_to_index_mode,
- S_IFGITLINK
+ S_IFGITLINK,
+ run_commit_hook
)
from gitdb.base import IStream
@@ -893,9 +894,12 @@ class IndexFile(LazyMixin, diff.Diffable, Serializable):
:note: If you have manually altered the .entries member of this instance,
don't forget to write() your changes to disk beforehand.
:return: Commit object representing the new commit"""
+ run_commit_hook('pre-commit', self)
tree = self.write_tree()
- return Commit.create_from_tree(self.repo, tree, message, parent_commits,
+ rval = Commit.create_from_tree(self.repo, tree, message, parent_commits,
head, author=author, committer=committer)
+ run_commit_hook('post-commit', self)
+ return rval
@classmethod
def _flush_stdin_and_wait(cls, proc, ignore_stdout=False):