I have a parameterized job which can build several Git branch. The "branch to build" is taken as job parameter.
Starting from a new job, firstly I build branch A, and then branch B. Then I'd like to rebuild branch A, without any commit in any branch in the meanwhile. But when I launch the build with branch A as parameter, Jenkins still checkouts the last built branch (B).
I suppose that Git plugin compare the SHA of the latest built commit with the SHA of the latest commit on remote branch: if this is different, all works as expected (checkout on the specified branch A), but if this is the same it still checkouts the last built branch B (why??).
If I purge Git Build Data as described here (https://plugins.jenkins.io/git/#remove-git-plugin-buildsbybranch-builddata-script) I can rebuild branch A (but I cannot do this purge anytime!)
Jenkins version: 2.164.3
Git plugin version: 4.2.2
Git client plugin version: 3.2.1
Job Type: Maven job