Closed exception0x876 closed 4 years ago
@exception0x876: Pls, remove trailing space from variable value.
Not my app, so not my decision, but why would you add these like this? External hooks are streamed the ref changes, which includes all the IDs, on their stdin. Passing ref IDs in the environment is wasteful/unnecessary.
More importantly, though, passing them in the environment is dangerous. When Bitbucket Server is hosted on Windows, the total environment block (all variables together) has a hard size limit. This code doesn't check how many IDs it's setting, or how large the resulting variable is. An initial push for a new repository created from an existing repository could easily exceed Windows's environment limit, causing the script to fail to start.
If your script wants to react to specific refs, read stdin and check the ref IDs there.
@bturner: that is good point and this change was not added to upstream version (hence PR is open).
Script stdin could be used to get ref changes.
This variable is useful for performing an action only if specific branches have changed.