Fix check if branch is outdated
Summary
Noone know why, but in some project merge request red by python-gitlab has attribute.diff_refs['start_sha']==attribute.diff_refs['base_sha']
even if mergereguest with that branch as source has some amount of commits behind master. This causes that outdated source branch and mergerequest are not deleted and after autoupdater runs source branch is still behinds target branch.
Steps to reproduce
- Run autoupdater in project
testowe/ansible-cloud-playbook
- Make some changes in master branch
- Run autoupdater again
- Do the same in
Repozytorium-danych-medycznych/medical-data-repository
(better wait for changes in master and runs again, probably that state is now avaiable as autoupdater runs everyday on that project)
Expected behavior
In both projects old merege request and branch should be replaced by new ones.
Actual behavior
Expected behavior happens only in test project.
Possible fixes
As tests shows we should check if branch is outdated by commparing sha of last commit from master and merege_request.diff_refs['base_sha']
not start_sha