See https://stash-dev.atlassian.com/projects/STASH/repos/stash/pull-requests/844/overview?commentId=13450