Extracted method getBranchesContaining() into GitClient to be used in Gi...

I need this method to fix issue JENKINS-24133