Advertisement
Guest User

Untitled

a guest
Mar 13th, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 0.74 KB | None | 0 0
  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.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement