Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I retrieve --push-option arguments in postReceive() of a Bitbucket Git hook?

unbrokenrabbit
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 17, 2018

I'm implementing a post-receive Git hook using Bitbucket's SDK.  I'm trying to retrieve the --push-option argument(s) that are passed via a call to git push (ie git push origin master --push-option=something), but I'm not having any luck in figuring out how these are made available to me via the RepositoryHookContext and collection of RefChange objects that are passed into the postReceive() method in the Bitbucket SDK.  If I were implementing a Git hook script directly my understanding is that I could retrieve the --push-option argument count via the GIT_PUSH_OPTION_COUNT environment variable, and then the actual --push-option argument values via GIT_PUSH_OPTION_0, GIT_PUSH_OPTION_1, etc environment variables.  I'm at a loss though as to how to retrieve this information from within the Bitbucket SDK.  Any help would be greatly appreciated.

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events