PageRenderTime 41ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/jgitflow-maven-plugin/src/it/projects/hotfix-finish-added-files/prebuild.groovy

https://bitbucket.org/atlassian/jgit-flow
Groovy | 16 lines | 12 code | 4 blank | 0 comment | 0 complexity | d2518cf71e9c445382be569da89772e3 MD5 | raw file
Possible License(s): Apache-2.0
  1. import com.atlassian.maven.plugins.jgitflow.it.FinishScriptHelper
  2. import org.apache.commons.io.FileUtils
  3. import org.eclipse.jgit.api.CreateBranchCommand
  4. helper = new FinishScriptHelper(basedir, localRepositoryPath, context)
  5. gits = helper.createAndCloneRepo("1.0","1.1-SNAPSHOT","1.0.1","hotfix/")
  6. localGit = gits.local;
  7. localGit.checkout().setUpstreamMode(CreateBranchCommand.SetupUpstreamMode.TRACK).setCreateBranch(true).setStartPoint("origin/hotfix/1.0.1").setName("hotfix/1.0.1").call()
  8. File junkFile = new File(localGit.getRepository().getWorkTree(), "junk.txt");
  9. FileUtils.writeStringToFile(junkFile, "I am junk");
  10. localGit.add().addFilepattern(junkFile.getName()).call();
  11. localGit.commit().setMessage("adding junk file").call();
  12. return true;