Package org.eclipse.jgit.api

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


        FileUtils.touch(new File(wcPath + "/hello"));
        FileUtils.touch(new File(wcPath + "/dir/world"));
        git.add().addFilepattern("hello").call();
        git.add().addFilepattern("dir").call();
        git.commit().setAuthor("yobi", "yobi@yobi.io").setMessage("test").call();
        git.branchCreate().setName(branchName).call();
        git.tag().setName(lightWeightTagName).setAnnotated(false).call();
        git.tag().setName(annotatedTagName).setAnnotated(true).setMessage("annotated tag").call();
        repository.close();

        running(support.Helpers.makeTestApplication(), new Runnable() {
View Full Code Here

        Repository repository = GitRepository.buildMergingRepository(pullRequest);

        Git git = new Git(repository);
        String branchName = "refs/heads/master";
        newCommit(original, repository, "readme.md", "Hello World", "Initial commit");
        git.branchCreate().setName("develop").setForce(true).call();
        GitRepository.checkout(repository, "develop");

        // When
        GitRepository.deleteBranch(repository, branchName);
View Full Code Here

        // 커밋이 없으면 HEAD도 없어서 브랜치 만들 때 에러가 발생하기 때문에 일단 하나 커밋한다.
        newCommit(original, repository, "readme.md", "hello 1", "commit 1");

        Git git = new Git(repository);
        String branchName = "new-branch";
        git.branchCreate()
                .setName(branchName)
                .setForce(true)
                .call();

        // When
View Full Code Here

        // master에 commit 1 추가
        newCommit(original, repository, "readme.md", "hello 1", "commit 1");
        // new-branch 생성
        Git git = new Git(repository);
        String branchName = "new-branch";
        git.branchCreate()
                .setName(branchName)
                .setForce(true)
                .call();
        // new-branch 로 이동
        GitRepository.checkout(repository, branchName);
View Full Code Here

        git.add().addFilepattern(dirName).call();
        git.add().addFilepattern(fileName).call();
        git.commit().setMessage("test").setAuthor(userName, email).call();

        String branchName = "testBranch";
        git.branchCreate()
                .setName(branchName)
                .setForce(true)
                .call();

        git.push()
View Full Code Here

            String localRepoPath = LOCAL_REPO_PREFIX + forkedProject.name;
            Git git = Git.cloneRepository()
                    .setURI(GitRepository.getGitDirectoryURL(forkedProject))
                    .setDirectory(new File(localRepoPath))
                    .call();
            git.branchCreate().setName("fix/1").call();
            git.checkout().setName("fix/1").call();
            Repository repo = git.getRepository();
            assertThat(repo.isBare()).describedAs("projectYobi-1 must be non-bare").isFalse();
            firstCommit = support.Git.commit(repo, repo.getWorkTree().getAbsolutePath(),
                    "test.txt", "apple\nbanana\ncorn\n", "commit 1");
View Full Code Here

                    for (Ref branchRef : refs)
                    {
                        String branchName = branchRef.getName();
                        if (branchName != null && branchName.endsWith(targetRef))
                        {
                            ref = repo.branchCreate().setName(targetRef).setUpstreamMode(SetupUpstreamMode.TRACK)
                                        .setStartPoint("origin/" + targetRef).call();
                        }
                    }
                }
View Full Code Here

                        {
                            ref = tags.get(version);

                            if (ref == null)
                            {
                                ref = repo.branchCreate().setName(version).setUpstreamMode(SetupUpstreamMode.TRACK)
                                            .setStartPoint("origin/" + version).call();
                            }
                        }
                    }
                }
View Full Code Here

  @Test
  public void testBranchConfiguration() throws Exception {
    Repository repo = lookupRepository(clonedRepositoryFile);
    Git git = new Git(repo);
    git.branchCreate().setName("configTest")
        .setStartPoint("refs/remotes/origin/master")
        .setUpstreamMode(SetupUpstreamMode.TRACK).call();

    boolean rebase = repo.getConfig().getBoolean(
        ConfigConstants.CONFIG_BRANCH_SECTION, "configTest",
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.