How to read file contents changed in a commit?

Kaushik Veluru
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 17, 2020

Hi, 

My requirement is to write a pre-receive hook which looks for a particular "Text" in changes of a commit and rejects the commit if "Text" is found. 

How do I accomplish this? I saw there is streamDiff() method but I couldn't find any examples regarding how to use Callback functionality. 

I am writing the pre-receive hook using ScriptRunner in groovy. 

Any example would be highly appreciated. Thanks

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events