Branch renaming to unmaintanted/ breaks the gate-check-commit
script when it sets the source branch for an upgrade job.
This patch determines the source branch prefix dynamically in
an attempt to make upgrade jobs still work from branches marked
as unmaintained under wider OpenStack policy.
Change-Id: I9662156fe0e9463e54ccc5c6ede0624a85887ebe