【发布时间】:2021-08-17 14:06:41
【问题描述】:
我想通过在 Gitlab CI 的 git 分支中更改的预提交文件进行检查。 --from-ref 我需要使用什么参数?
pre-commit run --from-ref=? --to-ref=HEAD
pre-commit 文档中的示例引发错误。
$ pre-commit run --from-ref=origin/HEAD --to-ref HEAD
An unexpected error has occurred: CalledProcessError: command: ('/usr/bin/git', 'diff', '--name-only', '--no-ext-diff', '-z', 'origin/HEAD...HEAD')
return code: 128
expected return code: 0
stdout: (none)
stderr:
fatal: ambiguous argument 'origin/HEAD...HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
【问题讨论】:
标签: gitlab gitlab-ci pre-commit.com