Package com.atlassian.jgitflow.core

Examples of com.atlassian.jgitflow.core.JGitFlowInitCommand


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

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

        //create a new file and add it to the index
        File junkFile = new File(git.getRepository().getWorkTree(), "junk.txt");
View Full Code Here


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

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

        //create a new commit
        File junkFile = new File(git.getRepository().getWorkTree(), "junk.txt");
View Full Code Here

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

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

        //just in case
        assertEquals(flow.getHotfixBranchPrefix() + "1.0", git.getRepository().getBranch());
View Full Code Here

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

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

        //create a new commit
        File junkFile = new File(git.getRepository().getWorkTree(), "junk.txt");
View Full Code Here

        Git remoteGit = null;
        remoteGit = RepoUtil.createRepositoryWithMasterAndDevelop(newDir());

        git = Git.cloneRepository().setDirectory(newDir()).setURI("file://" + remoteGit.getRepository().getWorkTree().getPath()).call();

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

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

        //do a commit to the remote develop branch
        remoteGit.checkout().setName(flow.getDevelopBranchName());
View Full Code Here

        Git remoteGit = null;
        remoteGit = RepoUtil.createRepositoryWithMasterAndDevelop(newDir());

        git = Git.cloneRepository().setDirectory(newDir()).setURI("file://" + remoteGit.getRepository().getWorkTree().getPath()).call();

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

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

        //do a commit to the remote develop branch
        remoteGit.checkout().setName(flow.getMasterBranchName());
View Full Code Here

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

        String masterBranchName = flow.getMasterBranchName();

        RevCommit oldMasterHead = GitHelper.getLatestCommit(git, masterBranchName );
View Full Code Here

{
    @Test
    public void initInCleanRepo() throws Exception
    {
        File workDir = newDir();
        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(workDir).call();

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

    {
        File workDir = newDir();
        InitContext ctx = new InitContext();
        ctx.setMaster("own").setDevelop("you");

        JGitFlowInitCommand initCommand = new JGitFlowInitCommand();
        JGitFlow flow = initCommand.setDirectory(workDir).setInitContext(ctx).call();

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

        File gitDir = new File(workDir, ".git");
View Full Code Here

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

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

TOP

Related Classes of com.atlassian.jgitflow.core.JGitFlowInitCommand

Copyright © 2018 www.massapicom. 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.