First, thank you for maintaining and developing this nice Git plugin!
Recently, I got some issues with some jobs using a wrong refspec to build. This only happened recently for jobs doing a "frech clone" and I suspect, only after an update of the Git Plugin.
Maybe what is particular on my side is that there are multiple branches in my repo and my refspec contains 'refs/heads' ("refs/heads/mptcp_trunk/master"). From what I see in PR-845, that's why the second fetch is not done but I don't know why it is an issue to add 'refs/heads' in the refspec. When I look at what is done by Jenkins, it looks like I could only add the name of the branch but if I have not to specified 'refs/heads', I am confused with the option name and the description
Also, I didn't set anything related to "Advanced Clone Option" as mentioned in the doc because I didn't find the corresponding option in the config (and to be honest, I don't know why I would like to do the clone and the fetch later differently ).
(Note: I added "origin/" in the branch name just to try but it didn't help. Just to explain why we see a reference to "origin/xxx" in the logs)
Here are the logs without "Preserve second fetch during checkout" option:
Here, you can see that all branches are fetches but then FETCH_HEAD is used with git checkout which is not correct: FETCH_HEAD corresponds to the first branch by alphabetical order on the remote (because we asked for refs/heads/*).
Now here is the output with "Preserve second fetch during checkout" on:
FETCH_HEAD is now corresponding to refs/heads/mptcp_trunk/master, what I want: then everything is OK.
I hope this will help finding the issue not to have to enable "Preserve second fetch during checkout" option.