SHARE
TWEET

Untitled

a guest Mar 13th, 2017 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     static def makeScmEditable(scm, env) {
  2.         Integer i
  3.  
  4.         def branches = []
  5.         for (i = 0; i < scm.branches.size(); i++) {
  6.             def it = scm.branches.get(i)
  7.             branches.add([name: it.getName()])
  8.         }
  9.  
  10.         def userRemoteConfigs = []
  11.         for (i = 0; i < scm.userRemoteConfigs.size(); i++) {
  12.             def it = scm.userRemoteConfigs.get(i)
  13.             userRemoteConfigs.add([
  14.             name:          it.getName(),
  15.             url:           it.getUrl(),
  16.             credentialsId: it.getCredentialsId(),
  17.             refspec:       it.getRefspec()
  18.             ])
  19.         }
  20.  
  21.         return [ $class: 'GitSCM', extensions: [], branches: branches, userRemoteConfigs: userRemoteConfigs ]
  22.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top