Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4896fa2

Browse files
authored
Merge pull request#479 from peterbe/commit-without-executing-hooks
Commit without executing hooks,fixes#468
2 parents3c6e5ad +e031a0e commit4896fa2

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

‎git/index/base.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -931,19 +931,24 @@ def move(self, items, skip_errors=False, **kwargs):
931931
returnout
932932

933933
defcommit(self,message,parent_commits=None,head=True,author=None,
934-
committer=None,author_date=None,commit_date=None):
934+
committer=None,author_date=None,commit_date=None,
935+
skip_hooks=False):
935936
"""Commit the current default index file, creating a commit object.
936937
For more information on the arguments, see tree.commit.
937938
938939
:note: If you have manually altered the .entries member of this instance,
939940
don't forget to write() your changes to disk beforehand.
941+
Passing skip_hooks=True is the equivalent of using `-n`
942+
or `--no-verify` on the command line.
940943
:return: Commit object representing the new commit"""
941-
run_commit_hook('pre-commit',self)
944+
ifnotskip_hooks:
945+
run_commit_hook('pre-commit',self)
942946
tree=self.write_tree()
943947
rval=Commit.create_from_tree(self.repo,tree,message,parent_commits,
944948
head,author=author,committer=committer,
945949
author_date=author_date,commit_date=commit_date)
946-
run_commit_hook('post-commit',self)
950+
ifnotskip_hooks:
951+
run_commit_hook('post-commit',self)
947952
returnrval
948953

949954
@classmethod

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp