Azure DevOps Server 2019 Cookbook(Second Edition)
上QQ阅读APP看书,第一时间看更新

How it works...

In the script, Git diff-index is used to identify the code increment being committed. This increment is then compared against the list of specified keywords. If any matches are found, an error is raised to block the commit; the script returns an error message with the list of matches. In this case, the pre-commit script doesn't return 0 (zero), which means the commit fails.