Hi,
I'm building a custom SCM, taking some inspiration from the git SCM plugin.
My plugin can now detect the branch names and revisions of a repository and this spawns the sub-jobs nicely.
However, it also spawns jobs for branches which do not have a Jenkinsfile.
From my understanding, if the SCMFile::content() function returns a FileNotFoundException, should this not prevent the creation of the branch job?
Instead, Jenkins reports that the light-weight fetch of Jenkinsfile failed for a specific branch, and instead it will now do a full checkout to get the Jenkinsfile. Which of course fails since those branches truly have no Jenkinsfile.
The branches that do have a Jenkinsfile seem to work as intended, so this is purely a problem with filtering out the branch heads which can not be built.
I saw that the git SCM uses 'traits' to stack filters - my code is not using traits - but I can not find where the check is done for the Jenkins file existence.
So how do I tell the multi-branch plugin to not build specific branches from within my custom SCM?
Cheers!