0

I am trying to validate a file on PreReceiveRepositoryHook and been following examples from atlassion site(https://bitbucket.org/roadsidepicnic/atlassian-bitbucket-check-commits-hook) and githup project (https://github.com/hmcmanus/yaml-validator-hook), neither one work because they can not find the commit just made. Anyone else facing same issue?

CommitRequest commitReq = new CommitRequest.Builder(repository, refChange.getToHash()).build();
Commit com1 = commitService.getCommit(commitReq);
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
a4anand
  • 11
  • 4

1 Answers1

0

Atlassian folks helped me solve the issue, here is the snippet, There are two remedies. Choose one of: 1.) Downgrade the version of git on your server to version 2.10.2 or older. OR: 2.) Update to Bitbucket Server 4.13.0 or newer. To do #2 in your first example you would adjust these values in that example's pom.xml. From this: 4.3.2 4.3.2 To this: 4.13.0 4.13.0

more details @ https://answers.atlassian.com/questions/46816348/commit-not-found-on-pre-receive-hook

a4anand
  • 11
  • 4