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