Examples of JGitFlowInitCommand


Examples of com.atlassian.jgitflow.core.JGitFlowInitCommand

        Git git = null;
        InitContext ctx = new InitContext();
        ctx.setMaster("own").setDevelop("you");

        git = RepoUtil.createRepositoryWithMaster(newDir());
        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(git.getRepository().getWorkTree()).setInitContext(ctx).call();

        flow.git().checkout().setName(flow.getDevelopBranchName()).call();
        assertEquals(flow.getDevelopBranchName(), flow.git().getRepository().getBranch());
       
        File gitDir = git.getRepository().getDirectory();
View Full Code Here

Examples of com.atlassian.jgitflow.core.JGitFlowInitCommand

        Git remoteGit = null;

        File workDir = newDir();
        remoteGit = RepoUtil.createRepositoryWithMaster(newDir());
        gfGit = Git.cloneRepository().setDirectory(workDir).setURI("file://" + remoteGit.getRepository().getWorkTree().getPath()).call();
        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(gfGit.getRepository().getWorkTree()).call();

        flow.git().checkout().setName("develop").call();
        assertEquals(flow.getDevelopBranchName(), flow.git().getRepository().getBranch());
       
        File gitDir = gfGit.getRepository().getDirectory();
View Full Code Here

Examples of com.atlassian.jgitflow.core.JGitFlowInitCommand

        InitContext ctx = new InitContext();
        ctx.setMaster("own").setDevelop("you");

        remoteGit = RepoUtil.createRepositoryWithMaster(newDir());
        gfGit = Git.cloneRepository().setDirectory(workDir).setURI("file://" + remoteGit.getRepository().getWorkTree().getPath()).call();
        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(gfGit.getRepository().getWorkTree()).setInitContext(ctx).call();

        flow.git().checkout().setName(flow.getDevelopBranchName()).call();
        assertEquals(flow.getDevelopBranchName(), flow.git().getRepository().getBranch());
       
        File gitDir = gfGit.getRepository().getDirectory();
View Full Code Here

Examples of com.atlassian.jgitflow.core.JGitFlowInitCommand

        InitContext ctx = new InitContext();
        ctx.setMaster("own").setDevelop("you");

        remoteGit = RepoUtil.createRepositoryWithBranches(newDir(), "own");
        gfGit = Git.cloneRepository().setDirectory(workDir).setURI("file://" + remoteGit.getRepository().getWorkTree().getPath()).call();
        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(gfGit.getRepository().getWorkTree()).setInitContext(ctx).call();

        flow.git().checkout().setName(flow.getDevelopBranchName()).call();
        assertEquals(flow.getDevelopBranchName(), flow.git().getRepository().getBranch());
       
        File gitDir = gfGit.getRepository().getDirectory();
View Full Code Here

Examples of com.atlassian.jgitflow.core.JGitFlowInitCommand

    @Test(expected = AlreadyInitializedException.class)
    public void initInExistingFlowRepo() throws Exception
    {
        Git git = null;
        git = RepoUtil.createRepositoryWithMaster(newDir());
        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        initCommand.setDirectory(git.getRepository().getWorkTree()).call();

        File gitDir = git.getRepository().getDirectory();
        File gitConfig = new File(gitDir, "config");

        assertTrue(gitConfig.exists());

        //try to re-init
        JGitFlowInitCommand initCommand2 = new JGitFlowInitCommand();

        //this should throw
        initCommand2.setDirectory(git.getRepository().getWorkTree()).call();

    }
View Full Code Here

Examples of com.atlassian.jgitflow.core.JGitFlowInitCommand

    public void initInExistingFlowRepoWithForce() throws Exception
    {
        Git git = null;

        git = RepoUtil.createRepositoryWithMaster(newDir());
        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(git.getRepository().getWorkTree()).call();

        File gitDir = git.getRepository().getDirectory();
        File gitConfig = new File(gitDir, "config");

        assertTrue(gitConfig.exists());

        //try to re-init
        JGitFlowInitCommand initCommand2 = new JGitFlowInitCommand();

        //this should NOT throw
        initCommand2.setDirectory(git.getRepository().getWorkTree()).setForce(true).call();

        String configText = new String(IO.readFully(gitConfig));

        assertTrue(configText.contains("[gitflow \"branch\"]"));
        assertTrue(configText.contains("[gitflow \"prefix\"]"));
View Full Code Here

Examples of com.atlassian.jgitflow.core.JGitFlowInitCommand

        Git git = null;

        InitContext ctx = new InitContext();
        ctx.setMaster("own").setDevelop("you");
        git = RepoUtil.createRepositoryWithMaster(newDir());
        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(git.getRepository().getWorkTree()).call();

        File gitDir = git.getRepository().getDirectory();
        File gitConfig = new File(gitDir, "config");

        assertTrue(gitConfig.exists());

        //try to re-init
        JGitFlowInitCommand initCommand2 = new JGitFlowInitCommand();

        //this should NOT throw
        JGitFlow flow2 = initCommand2.setDirectory(git.getRepository().getWorkTree()).setForce(true).setInitContext(ctx).call();

        String configText = new String(IO.readFully(gitConfig));

        assertTrue(configText.contains("[gitflow \"branch\"]"));
        assertTrue(configText.contains("[gitflow \"prefix\"]"));
View Full Code Here

Examples of com.atlassian.jgitflow.core.JGitFlowInitCommand

        File nested1 = new File(root,"nested1");
        File nested2 = new File(nested1,"nested2");
       
        nested2.mkdirs();
       
        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(nested2).call();

        flow.git().checkout().setName("develop").call();
        assertEquals(flow.getDevelopBranchName(), flow.git().getRepository().getBranch());

        File gitDir = git.getRepository().getDirectory();
View Full Code Here

Examples of com.atlassian.jgitflow.core.JGitFlowInitCommand

{
    @Test
    public void finishFeature() throws Exception
    {
        Git git = RepoUtil.createRepositoryWithMasterAndDevelop(newDir());
        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(git.getRepository().getWorkTree()).call();

        flow.featureStart("my-feature").call();

        //just in case
        assertEquals(flow.getFeatureBranchPrefix() + "my-feature", git.getRepository().getBranch());
View Full Code Here

Examples of com.atlassian.jgitflow.core.JGitFlowInitCommand

    @Test(expected = DirtyWorkingTreeException.class)
    public void finishFeatureWithUnStagedFile() throws Exception
    {
        Git git = RepoUtil.createRepositoryWithMasterAndDevelop(newDir());
        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(git.getRepository().getWorkTree()).call();

        flow.featureStart("my-feature").call();
       
        //create a new file
        File junkFile = new File(git.getRepository().getWorkTree(), "junk.txt");
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.