Closed d2roth closed 5 years ago
Sorry for the late response but it would be great if you could do a pull request indeed.
Thanks!
Okay. I will look into that. It might be a couple of days before I can get to it but anything I should know when making it?
Nothing special. I'll make some corrections if I see some possible improvements.
Cheers.
According to the documentation the commits in
$this->payload['push']['changes']
will not be complete.To remedy that issue there is the commits endpoint and you can find all of the commits present between two commits. The structure is as follows:
https://bitbucket.org/api/2.0/repositories/2.0/repositories/{username}/{repo_slug}/commits/{revision}
I made the following function and call it with:
There might be a more elegant way to grab all the files but this does the trick for now to retrieve all of the commits between two hashes. What I haven't checked is what happens when 2 commits are in different branches or other variations. Also while I was testing this I found if you create a new branch the old hash will be null so all of the commit's in the history before that branch will be retrieved. This means it can take a while for a branch to be pushed for the first time.
If you want I can make a pull request with this improvement.