hudson.plugins.git
Class GitAPI

java.lang.Object
  extended by hudson.plugins.git.GitAPI
All Implemented Interfaces:
IGitAPI

public class GitAPI
extends java.lang.Object
implements IGitAPI


Constructor Summary
GitAPI(java.lang.String gitExe, hudson.FilePath workspace, hudson.model.TaskListener listener)
           
 
Method Summary
 void add(java.lang.String filePattern)
           
 void branch(java.lang.String name)
           
 void changelog(java.lang.String revFrom, java.lang.String revTo, java.io.OutputStream fos)
           
 void checkout(java.lang.String ref)
           
 void clone(org.spearce.jgit.transport.RemoteConfig remoteConfig)
          Start from scratch and clone the whole repository.
 void commit(java.io.File f)
           
protected  java.util.Map<java.lang.String,java.lang.String> createEnvVarMap()
           
 void deleteTag(java.lang.String tagName)
           
 java.lang.String describe(java.lang.String commitIsh)
           
 void fetch()
           
 void fetch(org.spearce.jgit.transport.RemoteConfig remoteRepository)
           
 void fetch(java.lang.String repository, java.lang.String refspec)
           
 java.util.List<Branch> getBranches()
           
 java.util.List<Branch> getBranchesContaining(java.lang.String revspec)
           
 java.lang.String getGitExe()
           
 java.util.List<Branch> getRemoteBranches()
           
 java.util.List<org.spearce.jgit.lib.Tag> getTagsOnCommit(java.lang.String revName)
           
 boolean hasGitModules()
           
 boolean hasGitRepo()
           
 java.util.List<IndexEntry> lsTree(java.lang.String treeIsh)
           
 void merge(java.lang.String revSpec)
          Merge any changes into the head.
 org.spearce.jgit.lib.ObjectId mergeBase(org.spearce.jgit.lib.ObjectId id1, org.spearce.jgit.lib.ObjectId id2)
           
 void push(org.spearce.jgit.transport.RemoteConfig repository, java.lang.String refspec)
           
 java.util.List<org.spearce.jgit.lib.ObjectId> revList(java.lang.String... extraArgs)
           
 java.util.List<org.spearce.jgit.lib.ObjectId> revListAll()
           
 java.util.List<org.spearce.jgit.lib.ObjectId> revListBranch(java.lang.String branchId)
           
 org.spearce.jgit.lib.ObjectId revParse(java.lang.String revName)
           
 void submoduleInit()
          Init submodules.
 void submoduleUpdate()
          Update submodules.
 void tag(java.lang.String tagName, java.lang.String comment)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GitAPI

public GitAPI(java.lang.String gitExe,
              hudson.FilePath workspace,
              hudson.model.TaskListener listener)
Method Detail

getGitExe

public java.lang.String getGitExe()
Specified by:
getGitExe in interface IGitAPI

hasGitRepo

public boolean hasGitRepo()
                   throws GitException
Specified by:
hasGitRepo in interface IGitAPI
Throws:
GitException

hasGitModules

public boolean hasGitModules()
                      throws GitException
Specified by:
hasGitModules in interface IGitAPI
Throws:
GitException

fetch

public void fetch(java.lang.String repository,
                  java.lang.String refspec)
           throws GitException
Specified by:
fetch in interface IGitAPI
Throws:
GitException

fetch

public void fetch()
           throws GitException
Specified by:
fetch in interface IGitAPI
Throws:
GitException

clone

public void clone(org.spearce.jgit.transport.RemoteConfig remoteConfig)
           throws GitException
Start from scratch and clone the whole repository. Cloning into an existing directory is not allowed, so the workspace is first deleted entirely, then git clone is performed.

Specified by:
clone in interface IGitAPI
Throws:
GitException

revParse

public org.spearce.jgit.lib.ObjectId revParse(java.lang.String revName)
                                       throws GitException
Specified by:
revParse in interface IGitAPI
Throws:
GitException

describe

public java.lang.String describe(java.lang.String commitIsh)
                          throws GitException
Specified by:
describe in interface IGitAPI
Throws:
GitException

changelog

public void changelog(java.lang.String revFrom,
                      java.lang.String revTo,
                      java.io.OutputStream fos)
               throws GitException
Specified by:
changelog in interface IGitAPI
Throws:
GitException

merge

public void merge(java.lang.String revSpec)
           throws GitException
Merge any changes into the head.

Specified by:
merge in interface IGitAPI
Throws:
GitException

submoduleInit

public void submoduleInit()
                   throws GitException
Init submodules.

Specified by:
submoduleInit in interface IGitAPI
Throws:
GitException

submoduleUpdate

public void submoduleUpdate()
                     throws GitException
Update submodules.

Specified by:
submoduleUpdate in interface IGitAPI
Throws:
GitException

createEnvVarMap

protected final java.util.Map<java.lang.String,java.lang.String> createEnvVarMap()

tag

public void tag(java.lang.String tagName,
                java.lang.String comment)
         throws GitException
Specified by:
tag in interface IGitAPI
Throws:
GitException

push

public void push(org.spearce.jgit.transport.RemoteConfig repository,
                 java.lang.String refspec)
          throws GitException
Specified by:
push in interface IGitAPI
Throws:
GitException

getBranches

public java.util.List<Branch> getBranches()
                                   throws GitException
Specified by:
getBranches in interface IGitAPI
Throws:
GitException

getRemoteBranches

public java.util.List<Branch> getRemoteBranches()
                                         throws GitException,
                                                java.io.IOException
Specified by:
getRemoteBranches in interface IGitAPI
Throws:
GitException
java.io.IOException

getBranchesContaining

public java.util.List<Branch> getBranchesContaining(java.lang.String revspec)
                                             throws GitException
Specified by:
getBranchesContaining in interface IGitAPI
Throws:
GitException

checkout

public void checkout(java.lang.String ref)
              throws GitException
Specified by:
checkout in interface IGitAPI
Throws:
GitException

deleteTag

public void deleteTag(java.lang.String tagName)
               throws GitException
Specified by:
deleteTag in interface IGitAPI
Throws:
GitException

lsTree

public java.util.List<IndexEntry> lsTree(java.lang.String treeIsh)
                                  throws GitException
Specified by:
lsTree in interface IGitAPI
Throws:
GitException

revListAll

public java.util.List<org.spearce.jgit.lib.ObjectId> revListAll()
                                                         throws GitException
Specified by:
revListAll in interface IGitAPI
Throws:
GitException

revListBranch

public java.util.List<org.spearce.jgit.lib.ObjectId> revListBranch(java.lang.String branchId)
                                                            throws GitException
Specified by:
revListBranch in interface IGitAPI
Throws:
GitException

revList

public java.util.List<org.spearce.jgit.lib.ObjectId> revList(java.lang.String... extraArgs)
                                                      throws GitException
Throws:
GitException

add

public void add(java.lang.String filePattern)
         throws GitException
Specified by:
add in interface IGitAPI
Throws:
GitException

branch

public void branch(java.lang.String name)
            throws GitException
Specified by:
branch in interface IGitAPI
Throws:
GitException

commit

public void commit(java.io.File f)
            throws GitException
Specified by:
commit in interface IGitAPI
Throws:
GitException

fetch

public void fetch(org.spearce.jgit.transport.RemoteConfig remoteRepository)
           throws GitException
Specified by:
fetch in interface IGitAPI
Throws:
GitException

mergeBase

public org.spearce.jgit.lib.ObjectId mergeBase(org.spearce.jgit.lib.ObjectId id1,
                                               org.spearce.jgit.lib.ObjectId id2)
Specified by:
mergeBase in interface IGitAPI

getTagsOnCommit

public java.util.List<org.spearce.jgit.lib.Tag> getTagsOnCommit(java.lang.String revName)
                                                         throws GitException,
                                                                java.io.IOException
Specified by:
getTagsOnCommit in interface IGitAPI
Throws:
GitException
java.io.IOException


Copyright © 2009. All Rights Reserved.