mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-09 23:10:24 +01:00
experiments: commit with --no-verify in executors (#5078)
* git: add no_verify flag for commit() * experiments: commit with --no-verify in executors * git: wrap hook exceptions with SCMError * update hook file perms * update dulwich to 0.20.15 * update pygit2 commit def * skip hook tests on windows
This commit is contained in:
@@ -200,8 +200,13 @@ class GitPythonBackend(BaseGitBackend): # pylint:disable=abstract-method
|
||||
|
||||
logger.exception(msg)
|
||||
|
||||
def commit(self, msg: str):
|
||||
self.repo.index.commit(msg)
|
||||
def commit(self, msg: str, no_verify: bool = False):
|
||||
from git.exc import HookExecutionError
|
||||
|
||||
try:
|
||||
self.repo.index.commit(msg, skip_hooks=no_verify)
|
||||
except HookExecutionError as exc:
|
||||
raise SCMError("Git pre-commit hook failed") from exc
|
||||
|
||||
def checkout(
|
||||
self, branch: str, create_new: Optional[bool] = False, **kwargs
|
||||
|
||||
Reference in New Issue
Block a user