Package org.eclipse.jgit.api

Examples of org.eclipse.jgit.api.Git.commit()


        //commit the same file in feature to create a conflict
        git.checkout().setName(flow.getFeatureBranchPrefix() + "my-feature").call();
        FileUtils.writeStringToFile(junkFile, "B");
        git.add().addFilepattern(junkFile.getName()).call();
        git.commit().setMessage("committing junk file").call();

        boolean gotException = false;
        //try to finish
        try
        {
View Full Code Here


       
        assertEquals(flow.getDevelopBranchName(),git.getRepository().getBranch());

        FileUtils.writeStringToFile(junkFile, "A");
        git.add().addFilepattern(junkFile.getName()).setUpdate(true).call();
        git.commit().setMessage("merging").call();

        //try to finish again
        git.checkout().setName(flow.getFeatureBranchPrefix() + "my-feature").call();
        flow.featureFinish("my-feature").call();
View Full Code Here

        //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();
View Full Code Here

        //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()));
View Full Code Here

        //do a commit to the remote develop branch
        remoteGit.checkout().setName(flow.getDevelopBranchName());
        File junkFile = new File(remoteGit.getRepository().getWorkTree(), "junk.txt");
        FileUtils.writeStringToFile(junkFile, "I am junk");
        remoteGit.add().addFilepattern(junkFile.getName()).call();
        remoteGit.commit().setMessage("adding junk file").call();

        flow.hotfixFinish("1.0").setFetch(true).call();

    }
View Full Code Here

        //do a commit to the remote develop branch
        remoteGit.checkout().setName(flow.getMasterBranchName());
        File junkFile = new File(remoteGit.getRepository().getWorkTree(), "junk.txt");
        FileUtils.writeStringToFile(junkFile, "I am junk");
        remoteGit.add().addFilepattern(junkFile.getName()).call();
        remoteGit.commit().setMessage("adding junk file").call();

        flow.hotfixFinish("1.0").setFetch(true).call();

    }
View Full Code Here

        //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();
        git.commit().setMessage("committing junk file").call();

        flow.hotfixFinish("1.0").setNoTag( false ).call();

        //we should be on develop branch
        assertEquals(flow.getDevelopBranchName(), git.getRepository().getBranch());
View Full Code Here

        assertEquals(flow.getHotfixBranchPrefix() + hfOneLabel, git.getRepository().getBranch());

        File versionFile = new File(git.getRepository().getWorkTree(), "version.txt");
        FileUtils.writeStringToFile(versionFile, hfOneLabel);
        git.add().addFilepattern(".").call();
        git.commit().setMessage("commiting version 1").call();
       
        flow.hotfixFinish(hfOneLabel).call();

        //we should be on develop branch
        assertEquals(flow.getDevelopBranchName(), git.getRepository().getBranch());
View Full Code Here

        //we should be on develop branch
        assertEquals(flow.getDevelopBranchName(), git.getRepository().getBranch());
        FileUtils.writeStringToFile(versionFile, "develop");
        git.add().addFilepattern(".").call();
        git.commit().setMessage("commiting develop").call();
       
        flow.hotfixStart(hfTwoLabel).call();

        assertEquals(flow.getHotfixBranchPrefix() + hfTwoLabel, git.getRepository().getBranch());
View Full Code Here

        assertEquals(flow.getHotfixBranchPrefix() + hfTwoLabel, git.getRepository().getBranch());

        FileUtils.writeStringToFile(versionFile, hfTwoLabel);
        git.add().addFilepattern(".").call();
        git.commit().setMessage("commiting version 2").call();

        flow.hotfixFinish(hfTwoLabel).call();

        //we should be on develop branch
        assertEquals(flow.getDevelopBranchName(), git.getRepository().getBranch());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.