Examples of branchCreate()


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

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

        git.branchCreate().setName(flow.getHotfixBranchPrefix() + "1.0").call();

        flow.hotfixStart("1.0").call();
    }

    @Test(expected = TagExistsException.class)
View Full Code Here

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

    public static Git createRepositoryWithMasterAndDevelop(File dir) throws GitAPIException
    {
        Git git =  Git.init().setDirectory(dir).call();
        git.commit().setMessage("initial commit").call();
        git.branchCreate().setName("develop").call();
        git.commit().setMessage("added develop branch").call();
       
        return git;
    }
View Full Code Here

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

        Git git =  Git.init().setDirectory(dir).call();
        git.commit().setMessage("initial commit").call();
       
        for(String branch : branches)
        {
            git.branchCreate().setName(branch).call();
            git.commit().setMessage("added branch " + branch).call();
        }
       
        return git;
    }
View Full Code Here

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

            List<Ref> refs = GitUtils.getRemoteBranches(repo);
            for (Ref branchRef : refs)
            {
               if (branchRef.getName().endsWith(targetRef))
               {
                  ref = repo.branchCreate().setName(targetRef).setUpstreamMode(SetupUpstreamMode.TRACK)
                           .setStartPoint("origin/" + targetRef).call();
               }
            }
         }
View Full Code Here

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

            //if no local master exists, but a remote does, check it out
            if (!GitHelper.localBranchExists(git, context.getMaster()) && GitHelper.remoteBranchExists(git, context.getMaster(), reporter))
            {
                reporter.debugText(SHORT_NAME,"creating new local master branch from origin master");
                git.branchCreate()
                   .setName(context.getMaster())
                   .setUpstreamMode(CreateBranchCommand.SetupUpstreamMode.SET_UPSTREAM)
                   .setStartPoint("origin/" + context.getMaster())
                   .call();
            }
View Full Code Here

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

            if (!GitHelper.localBranchExists(git, context.getDevelop()))
            {
                if (GitHelper.remoteBranchExists(git, context.getDevelop(), reporter))
                {
                    reporter.debugText(SHORT_NAME,"creating new local develop branch from origin develop");
                    git.branchCreate()
                       .setName(context.getDevelop())
                       .setUpstreamMode(CreateBranchCommand.SetupUpstreamMode.SET_UPSTREAM)
                       .setStartPoint("origin/" + context.getDevelop())
                       .call();
                }
View Full Code Here

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

                       .call();
                }
                else
                {
                    reporter.debugText(SHORT_NAME,"creating new local develop branch without origin");
                    git.branchCreate()
                       .setName(context.getDevelop())
                       .setUpstreamMode(CreateBranchCommand.SetupUpstreamMode.NOTRACK)
                       .call();
                }
            }
View Full Code Here

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

  protected RevCommit commitFile(String filename, String contents, String branch) {
    try {
      Git git = new Git(db);
      String originalBranch = git.getRepository().getFullBranch();
      if (git.getRepository().getRef(branch) == null)
        git.branchCreate().setName(branch).call();
      git.checkout().setName(branch).call();
      writeTrashFile(filename, contents);
      git.add().addFilepattern(filename).call();
      RevCommit commit = git.commit()
          .setMessage(branch + ": " + filename).call();
View Full Code Here

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

            else
            {
                //if no local master exists, but a remote does, check it out
                if (!GitHelper.localBranchExists(git, context.getMaster()) && GitHelper.remoteBranchExists(git, context.getMaster()))
                {
                    git.branchCreate()
                       .setName(context.getMaster())
                       .setUpstreamMode(CreateBranchCommand.SetupUpstreamMode.SET_UPSTREAM)
                       .setStartPoint("origin/" + context.getMaster())
                       .call();
                }
View Full Code Here

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

            //creation of develop
            if (!GitHelper.localBranchExists(git, context.getDevelop()))
            {
                if (GitHelper.remoteBranchExists(git, context.getDevelop()))
                {
                    git.branchCreate()
                       .setName(context.getDevelop())
                       .setUpstreamMode(CreateBranchCommand.SetupUpstreamMode.SET_UPSTREAM)
                       .setStartPoint("origin/" + context.getDevelop())
                       .call();
                }
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.