Bitbucket version: 4.9.1
I’ve been working on a Bitbucket Hook plugin and my initial goal is to create a plugin which will allow me to reject a commit based on the commit author. I’ve been using an open source hook as a reference (Yet Another Commit Checker)
I am currently attempting to parse the commit using GitRevListBuilder from the Bitbucket API using something along the lines of
GitRevListBuilder revListBuilder = ((GitScmCommandBuilder)scmService.createBuilder(repository)).revList()
.format("%H%x02%P%x02%cN%x02%cE%n%B%n%x03END%x04")
.revs(rf.getToHash()), "--not","--all");
names = revListBuilder.build(new commitListOutputHandler()).call();
but every time I run the build method I get an exception
Commit '9bd33f587458bf9fb69ca1bcd5a39579be20e5fa' does not exist in repository 'rep_1'.
the commit in the exception corresponds to the commit I am trying to push.
This strategy is being used by a live plugin so ostensibly it should work but I am guessing that I am forgetting subtle detail.