What does this MR do?
Preserve branch information for checkouts.
Why was this MR needed?
This patch adds
-B branchname to checkout.
This is needed for tools that rely on branch information that gets lost with the current
git checkout hash.
it's basically the same as running:
git checkout branchname
git reset --hard hash
Are there points in the code the reviewer needs to double check?
Theoretically there may need to check if the remote branchname still exists when the build is ran. Perhaps the runner was offline for a while and the time the job actually gets run developer has removed the branch on remote.
It's probably very rare situation and current solution would behave even better replicating scenario when the commit was made.
Does this MR meet the acceptance criteria?
Added for this feature/bug
All builds are passing
Branch has no merge conflicts with
master(if you do - rebase it please)