Package org.eclipse.jgit.api

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


        // remove the tag again
        git.tagDelete().setTags("tag_for_testing").call();

        // create an annotated tag
        tag = git.tag().setName("tag_for_testing").setAnnotated(true).call();
        System.out.println("Created/moved tag " + tag + " to repository at " + repository.getDirectory());

        // remove the tag again
        git.tagDelete().setTags("tag_for_testing").call();
View Full Code Here


    FileUtils.createNewFile(file);
    Git git = new Git(repository1.getRepository());
    git.add().addFilepattern("file1.txt").call();

    git.commit().setMessage("first commit").call();
    git.tag().setName("tag").call();

    file = new File(workdir, "file2.txt");
    FileUtils.createNewFile(file);
    git.add().addFilepattern("file2.txt").call();
    git.commit().setMessage("second commit").call();
View Full Code Here

  public void setUp() throws Exception {
    super.setUp();
    db = createWorkRepository();
    Git git = new Git(db);
    git.commit().setMessage("initial commit").call();
    git.tag().setName(INITIAL_TAG).call();
  }

  protected void assertFileAddition(Map<String, Change> result, String path, String fileName) {
    commonFileAsserts(result, path, fileName);
    assertThat(result.get(path).getKind(), is(RIGHT | ADDITION));
View Full Code Here

  }

  @Test
  public void pushTag() throws Exception {
    Git git = new Git(repository);
    git.tag().setName("foo").setMessage("Foo tag").call();

    PushTagsWizardTester wizard = PushTagsWizardTester
        .startWizard(selectProject());
    wizard.selectRemote("push");
    wizard.assertNextDisabled();
View Full Code Here

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

        git.tag().setName(flow.getVersionTagPrefix() + "1.0").call();

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

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

        InitContext ctx = new InitContext();
        ctx.setVersiontag("vtag/");
       
        JGitFlow flow = initCommand.setInitContext(ctx).setDirectory(git.getRepository().getWorkTree()).call();

        git.tag().setName(flow.getVersionTagPrefix() + "1.0").call();
       
        //just to make sure
        List<Ref> refs = git.tagList().call();
        String name = refs.get(0).getName();
       
View Full Code Here

        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(git.getRepository().getWorkTree()).call();
        git.push().setRemote("origin").add("develop").call();

        //add the remote tag
        remoteGit.tag().setName(flow.getVersionTagPrefix() + "1.0").call();

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

    }
View Full Code Here

        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(git.getRepository().getWorkTree()).call();
        git.push().setRemote("origin").add("develop").call();

        //add the remote tag
        remoteGit.tag().setName(flow.getVersionTagPrefix() + "1.0").call();

        flow.releaseStart("1.0").call();

        assertEquals(flow.getReleaseBranchPrefix() + "1.0", git.getRepository().getBranch());
View Full Code Here

    @Test
    public void localTagExists() throws Exception
    {
        Git git = RepoUtil.createRepositoryWithMaster(newDir());
        git.tag().setName("1.0").setMessage("tagged 1.0").call();

        assertTrue(GitHelper.tagExists(git,"1.0"));
    }

    @Test
View Full Code Here

        Git git = null;
        Git remoteGit = null;
        remoteGit = RepoUtil.createRepositoryWithMasterAndDevelop(newDir());
        git = Git.cloneRepository().setDirectory(newDir()).setURI("file://" + remoteGit.getRepository().getWorkTree().getPath()).call();
       
        remoteGit.tag().setName("1.0").setMessage("tagged 1.0").call();
       
        git.fetch().call();
       
        assertTrue(GitHelper.tagExists(git,"1.0"));
    }
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.