Package org.eclipse.jgit.api

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


public class RepoUtil
{
    public static Git createEmptyRepository(File dir) throws GitAPIException
    {
        Git git = Git.init().setDirectory(dir).setBare(true).call();
        git.commit().setMessage("initial commit").call();
       
        return git;
    }

    public static Git createRepositoryWithMaster(File dir) throws GitAPIException
View Full Code Here


    }

    public static Git createRepositoryWithMaster(File dir) throws GitAPIException
    {
        Git git =  Git.init().setDirectory(dir).call();
        git.commit().setMessage("initial commit").call();
       
        return git;
    }

    public static Git createRepositoryWithMasterAndDevelop(File dir) throws GitAPIException
View Full Code Here

    }

    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

    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;
    }

    public static Git createRepositoryWithBranches(File dir, String ... branches) throws GitAPIException
View Full Code Here

    }

    public static Git createRepositoryWithBranches(File dir, String ... branches) throws GitAPIException
    {
        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();
View Full Code Here

        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

                reporter.debugText(SHORT_NAME,"no commits found on master. creating initial commit.");
                RefUpdate refUpdate = repo.getRefDatabase().newUpdate(Constants.HEAD, false);
                refUpdate.setForceUpdate(true);
                refUpdate.link(Constants.R_HEADS + context.getMaster());

                git.commit().setMessage("Initial Commit").call();
            }

            //creation of develop
            if (!GitHelper.localBranchExists(git, context.getDevelop()))
            {
View Full Code Here

      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();
      if (originalBranch != null)
        git.checkout().setName(originalBranch).call();
      return commit;
    } catch (IOException e) {
View Full Code Here

            {
                RefUpdate refUpdate = repo.getRefDatabase().newUpdate(Constants.HEAD, false);
                refUpdate.setForceUpdate(true);
                refUpdate.link(Constants.R_HEADS + context.getMaster());

                git.commit().setMessage("Initial Commit").call();
            }

            //creation of develop
            if (!GitHelper.localBranchExists(git, context.getDevelop()))
            {
View Full Code Here

            {
                UserInfo author = getAuthor( repo, git );
                UserInfo committer = getCommitter( repo, git );

                RevCommit commitRev =
                    git.commit().setMessage( message ).setAuthor( author.name, author.email ).setCommitter( committer.name,
                                                                                                            committer.email ).call();
                getLogger().info( "commit done: " + commitRev.getShortMessage() );
                checkedInFiles = JGitUtils.getFilesInCommit( git.getRepository(), commitRev );
                if ( getLogger().isDebugEnabled() )
                {
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.