}
@Test
public void finishHotfixWithMultipleCommits() throws Exception
{
Git git = RepoUtil.createRepositoryWithMasterAndDevelop(newDir());
JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
JGitFlow flow = initCommand.setDirectory(git.getRepository().getWorkTree()).call();
flow.hotfixStart("1.0").call();
//create a new commit
File junkFile = new File(git.getRepository().getWorkTree(), "junk.txt");
FileUtils.writeStringToFile(junkFile, "I am junk");
git.add().addFilepattern(junkFile.getName()).call();
RevCommit commit = git.commit().setMessage("committing junk file").call();
//create second commit
File junkFile2 = new File(git.getRepository().getWorkTree(), "junk2.txt");
FileUtils.writeStringToFile(junkFile2, "I am junk, and so are you");
git.add().addFilepattern(junkFile2.getName()).call();
RevCommit commit2 = git.commit().setMessage("updating junk file").call();
//make sure develop doesn't have our commits yet
assertFalse(GitHelper.isMergedInto(git, commit, flow.getDevelopBranchName()));
assertFalse(GitHelper.isMergedInto(git, commit2, flow.getDevelopBranchName()));
//try to finish
flow.hotfixFinish("1.0").call();
//we should be on develop branch
assertEquals(flow.getDevelopBranchName(), git.getRepository().getBranch());
//release branch should be gone
Ref ref2check = git.getRepository().getRef(flow.getHotfixBranchPrefix() + "1.0");
assertNull(ref2check);
//the develop branch should have both of our commits now
assertTrue(GitHelper.isMergedInto(git, commit, flow.getDevelopBranchName()));
assertTrue(GitHelper.isMergedInto(git, commit2, flow.getDevelopBranchName()));