Fix javadoc in org.eclipse.jgit annotations and api packages

Change-Id: I2761ea91f8dfed16ea54e7a6646af03a30c15ec9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
Matthias Sohn 2017-12-18 00:18:40 +01:00
parent 4e27a16081
commit 0210e0e299
93 changed files with 1389 additions and 725 deletions

View File

@ -89,7 +89,6 @@
* @see <a href=
* "http://types.cs.washington.edu/checker-framework/current/checker-framework-manual.html#faq-array-syntax-meaning">
* The checker-framework manual</a>
*
* @since 4.2
*/
@Documented

View File

@ -91,8 +91,10 @@ public class AddCommand extends GitCommand<DirCache> {
private boolean update = false;
/**
* Constructor for AddCommand
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
public AddCommand(Repository repo) {
super(repo);
@ -119,7 +121,10 @@ public AddCommand addFilepattern(String filepattern) {
/**
* Allow clients to provide their own implementation of a FileTreeIterator
*
* @param f
* a {@link org.eclipse.jgit.treewalk.WorkingTreeIterator}
* object.
* @return {@code this}
*/
public AddCommand setWorkingTreeIterator(WorkingTreeIterator f) {
@ -128,11 +133,11 @@ public AddCommand setWorkingTreeIterator(WorkingTreeIterator f) {
}
/**
* {@inheritDoc}
* <p>
* Executes the {@code Add} command. Each instance of this class should only
* be used for one invocation of the command. Don't call this method twice
* on an instance.
*
* @return the DirCache after Add
*/
@Override
public DirCache call() throws GitAPIException, NoFilepatternException {
@ -260,17 +265,18 @@ public DirCache call() throws GitAPIException, NoFilepatternException {
}
/**
* Set whether to only match against already tracked files
*
* @param update
* If set to true, the command only matches {@code filepattern}
* against already tracked files in the index rather than the
* working tree. That means that it will never stage new files,
* but that it will stage modified new contents of tracked files
* and that it will remove files from the index if the
* corresponding files in the working tree have been removed.
* In contrast to the git command line a {@code filepattern} must
* exist also if update is set to true as there is no
* concept of a working directory here.
*
* corresponding files in the working tree have been removed. In
* contrast to the git command line a {@code filepattern} must
* exist also if update is set to true as there is no concept of
* a working directory here.
* @return {@code this}
*/
public AddCommand setUpdate(boolean update) {
@ -279,7 +285,9 @@ public AddCommand setUpdate(boolean update) {
}
/**
* @return is the parameter update is set
* Whether to only match against already tracked files
*
* @return whether to only match against already tracked files
*/
public boolean isUpdate() {
return update;

View File

@ -75,12 +75,16 @@ public class AddNoteCommand extends GitCommand<Note> {
private String notesRef = Constants.R_NOTES_COMMITS;
/**
* Constructor for AddNoteCommand
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
protected AddNoteCommand(Repository repo) {
super(repo);
}
/** {@inheritDoc} */
@Override
public Note call() throws GitAPIException {
checkCallable();
@ -108,6 +112,7 @@ public Note call() throws GitAPIException {
* has a note, the existing note will be replaced.
*
* @param id
* a {@link org.eclipse.jgit.revwalk.RevObject}
* @return {@code this}
*/
public AddNoteCommand setObjectId(RevObject id) {
@ -117,6 +122,8 @@ public AddNoteCommand setObjectId(RevObject id) {
}
/**
* Set the notes message
*
* @param message
* the notes message used when adding a note
* @return {@code this}
@ -152,12 +159,13 @@ private void commitNoteMap(RevWalk walk, NoteMap map,
}
/**
* Set name of a {@code Ref} to read notes from
*
* @param notesRef
* the ref to read notes from. Note, the default value of
* {@link Constants#R_NOTES_COMMITS} will be used if nothing is
* set
* {@link org.eclipse.jgit.lib.Constants#R_NOTES_COMMITS} will be
* used if nothing is set
* @return {@code this}
*
* @see Constants#R_NOTES_COMMITS
*/
public AddNoteCommand setNotesRef(String notesRef) {

View File

@ -87,6 +87,8 @@ public class ApplyCommand extends GitCommand<ApplyResult> {
}
/**
* Set patch
*
* @param in
* the patch to apply
* @return this instance
@ -98,16 +100,13 @@ public ApplyCommand setPatch(InputStream in) {
}
/**
* {@inheritDoc}
* <p>
* Executes the {@code ApplyCommand} command with all the options and
* parameters collected by the setter methods (e.g.
* {@link #setPatch(InputStream)} of this class. Each instance of this class
* should only be used for one invocation of the command. Don't call this
* method twice on an instance.
*
* @return an {@link ApplyResult} object representing the command result
* @throws GitAPIException
* @throws PatchFormatException
* @throws PatchApplyException
*/
@Override
public ApplyResult call() throws GitAPIException, PatchFormatException,

View File

@ -47,7 +47,7 @@
import java.util.List;
/**
* Encapsulates the result of a {@link ApplyCommand}
* Encapsulates the result of a {@link org.eclipse.jgit.api.ApplyCommand}
*
* @since 2.0
*/
@ -56,6 +56,8 @@ public class ApplyResult {
private List<File> updatedFiles = new ArrayList<>();
/**
* Add updated file
*
* @param f
* an updated file
* @return this instance
@ -67,6 +69,8 @@ public ApplyResult addUpdatedFile(File f) {
}
/**
* Get updated files
*
* @return updated files
*/
public List<File> getUpdatedFiles() {

View File

@ -70,19 +70,16 @@
/**
* Create an archive of files from a named tree.
* <p>
* Examples (<code>git</code> is a {@link Git} instance):
* Examples (<code>git</code> is a {@link org.eclipse.jgit.api.Git} instance):
* <p>
* Create a tarball from HEAD:
*
* <pre>
* ArchiveCommand.registerFormat("tar", new TarFormat());
* try {
* git.archive()
* .setTree(db.resolve(&quot;HEAD&quot;))
* .setOutputStream(out)
* .call();
* git.archive().setTree(db.resolve(&quot;HEAD&quot;)).setOutputStream(out).call();
* } finally {
* ArchiveCommand.unregisterFormat("tar");
* ArchiveCommand.unregisterFormat("tar");
* }
* </pre>
* <p>
@ -103,7 +100,6 @@
*
* @see <a href="http://git-htmldocs.googlecode.com/git/git-archive.html" >Git
* documentation about archive</a>
*
* @since 3.1
*/
public class ArchiveCommand extends GitCommand<OutputStream> {
@ -383,7 +379,10 @@ private static Format<?> lookupFormat(String formatName) throws UnsupportedForma
private String suffix;
/**
* Constructor for ArchiveCommand
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
public ArchiveCommand(Repository repo) {
super(repo);
@ -440,9 +439,7 @@ private <T extends Closeable> OutputStream writeArchive(Format<T> fmt) {
}
}
/**
* @return the stream to which the archive has been written
*/
/** {@inheritDoc} */
@Override
public OutputStream call() throws GitAPIException {
checkCallable();
@ -456,6 +453,8 @@ public OutputStream call() throws GitAPIException {
}
/**
* Set the tag, commit, or tree object to produce an archive for
*
* @param tree
* the tag, commit, or tree object to produce an archive for
* @return this
@ -470,6 +469,8 @@ public ArchiveCommand setTree(ObjectId tree) {
}
/**
* Set string prefixed to filenames in archive
*
* @param prefix
* string prefixed to filenames in archive (e.g., "master/").
* null means to not use any leading prefix.
@ -502,8 +503,10 @@ public ArchiveCommand setFilename(String filename) {
}
/**
* Set output stream
*
* @param out
* the stream to which to write the archive
* the stream to which to write the archive
* @return this
*/
public ArchiveCommand setOutputStream(OutputStream out) {
@ -512,10 +515,11 @@ public ArchiveCommand setOutputStream(OutputStream out) {
}
/**
* Set archive format
*
* @param fmt
* archive format (e.g., "tar" or "zip").
* null means to choose automatically based on
* the archive filename.
* archive format (e.g., "tar" or "zip"). null means to choose
* automatically based on the archive filename.
* @return this
*/
public ArchiveCommand setFormat(String fmt) {
@ -524,6 +528,8 @@ public ArchiveCommand setFormat(String fmt) {
}
/**
* Set archive format options
*
* @param options
* archive format options (e.g., level=9 for zip compression).
* @return this

View File

@ -69,7 +69,8 @@
import org.eclipse.jgit.util.io.AutoLFInputStream;
/**
* Blame command for building a {@link BlameResult} for a file path.
* Blame command for building a {@link org.eclipse.jgit.blame.BlameResult} for a
* file path.
*/
public class BlameCommand extends GitCommand<BlameResult> {
@ -86,7 +87,10 @@ public class BlameCommand extends GitCommand<BlameResult> {
private Boolean followFileRenames;
/**
* Constructor for BlameCommand
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
public BlameCommand(Repository repo) {
super(repo);
@ -108,6 +112,7 @@ public BlameCommand setFilePath(String filePath) {
* Set diff algorithm
*
* @param diffAlgorithm
* a {@link org.eclipse.jgit.diff.DiffAlgorithm} object.
* @return this command
*/
public BlameCommand setDiffAlgorithm(DiffAlgorithm diffAlgorithm) {
@ -119,6 +124,7 @@ public BlameCommand setDiffAlgorithm(DiffAlgorithm diffAlgorithm) {
* Set raw text comparator
*
* @param textComparator
* a {@link org.eclipse.jgit.diff.RawTextComparator}
* @return this command
*/
public BlameCommand setTextComparator(RawTextComparator textComparator) {
@ -130,6 +136,7 @@ public BlameCommand setTextComparator(RawTextComparator textComparator) {
* Set start commit id
*
* @param commit
* id of a commit
* @return this command
*/
public BlameCommand setStartCommit(AnyObjectId commit) {
@ -164,7 +171,7 @@ public BlameCommand setFollowFileRenames(boolean follow) {
* most recent commit to stop traversal at. Usually an active
* branch tip, tag, or HEAD.
* @return {@code this}
* @throws IOException
* @throws java.io.IOException
* the repository cannot be read.
*/
public BlameCommand reverse(AnyObjectId start, AnyObjectId end)
@ -182,7 +189,7 @@ public BlameCommand reverse(AnyObjectId start, AnyObjectId end)
* most recent commits to stop traversal at. Usually an active
* branch tip, tag, or HEAD.
* @return {@code this}
* @throws IOException
* @throws java.io.IOException
* the repository cannot be read.
*/
public BlameCommand reverse(AnyObjectId start, Collection<ObjectId> end)
@ -193,10 +200,10 @@ public BlameCommand reverse(AnyObjectId start, Collection<ObjectId> end)
}
/**
* {@inheritDoc}
* <p>
* Generate a list of lines with information about when the lines were
* introduced into the file path.
*
* @return list of lines
*/
@Override
public BlameResult call() throws GitAPIException {

View File

@ -91,7 +91,7 @@
/**
* Checkout a branch to the working tree.
* <p>
* Examples (<code>git</code> is a {@link Git} instance):
* Examples (<code>git</code> is a {@link org.eclipse.jgit.api.Git} instance):
* <p>
* Check out an existing branch:
*
@ -126,9 +126,9 @@
* .setStartPoint(&quot;origin/stable&quot;).call();
* </pre>
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-checkout.html"
* >Git documentation about Checkout</a>
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-checkout.html" >Git
* documentation about Checkout</a>
*/
public class CheckoutCommand extends GitCommand<Ref> {
@ -183,26 +183,17 @@ private Stage(int number) {
private Set<String> actuallyModifiedPaths;
/**
* Constructor for CheckoutCommand
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
protected CheckoutCommand(Repository repo) {
super(repo);
this.paths = new LinkedList<>();
}
/**
* @throws RefAlreadyExistsException
* when trying to create (without force) a branch with a name
* that already exists
* @throws RefNotFoundException
* if the start point or branch can not be found
* @throws InvalidRefNameException
* if the provided name is <code>null</code> or otherwise
* invalid
* @throws CheckoutConflictException
* if the checkout results in a conflict
* @return the newly created branch
*/
/** {@inheritDoc} */
@Override
public Ref call() throws GitAPIException, RefAlreadyExistsException,
RefNotFoundException, InvalidRefNameException,
@ -418,11 +409,12 @@ public CheckoutCommand setAllPaths(boolean all) {
/**
* Checkout paths into index and working directory, firing a
* {@link WorkingTreeModifiedEvent} if the working tree was modified.
* {@link org.eclipse.jgit.events.WorkingTreeModifiedEvent} if the working
* tree was modified.
*
* @return this instance
* @throws IOException
* @throws RefNotFoundException
* @throws java.io.IOException
* @throws org.eclipse.jgit.api.errors.RefNotFoundException
*/
protected CheckoutCommand checkoutPaths() throws IOException,
RefNotFoundException {
@ -739,6 +731,8 @@ public CheckoutCommand setStage(Stage stage) {
}
/**
* <p>getResult.</p>
*
* @return the result, never <code>null</code>
*/
public CheckoutResult getResult() {

View File

@ -46,8 +46,7 @@
import java.util.List;
/**
* Encapsulates the result of a {@link CheckoutCommand}
*
* Encapsulates the result of a {@link org.eclipse.jgit.api.CheckoutCommand}
*/
public class CheckoutResult {
@ -168,6 +167,8 @@ public enum Status {
}
/**
* Get status
*
* @return the status
*/
public Status getStatus() {
@ -175,33 +176,44 @@ public Status getStatus() {
}
/**
* Get list of file that created a checkout conflict
*
* @return the list of files that created a checkout conflict, or an empty
* list if {@link #getStatus()} is not {@link Status#CONFLICTS};
* list if {@link #getStatus()} is not
* {@link org.eclipse.jgit.api.CheckoutResult.Status#CONFLICTS};
*/
public List<String> getConflictList() {
return conflictList;
}
/**
* Get the list of files that could not be deleted during checkout
*
* @return the list of files that could not be deleted during checkout, or
* an empty list if {@link #getStatus()} is not
* {@link Status#NONDELETED};
* {@link org.eclipse.jgit.api.CheckoutResult.Status#NONDELETED};
*/
public List<String> getUndeletedList() {
return undeletedList;
}
/**
* Get the list of files that where modified during checkout
*
* @return the list of files that where modified during checkout, or an
* empty list if {@link #getStatus()} is not {@link Status#OK}
* empty list if {@link #getStatus()} is not
* {@link org.eclipse.jgit.api.CheckoutResult.Status#OK}
*/
public List<String> getModifiedList() {
return modifiedList;
}
/**
* Get the list of files that where removed during checkout
*
* @return the list of files that where removed during checkout, or an empty
* list if {@link #getStatus()} is not {@link Status#OK}
* list if {@link #getStatus()} is not
* {@link org.eclipse.jgit.api.CheckoutResult.Status#OK}
*/
public List<String> getRemovedList() {
return removedList;

View File

@ -96,25 +96,22 @@ public class CherryPickCommand extends GitCommand<CherryPickResult> {
private boolean noCommit = false;
/**
* Constructor for CherryPickCommand
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
protected CherryPickCommand(Repository repo) {
super(repo);
}
/**
* {@inheritDoc}
* <p>
* Executes the {@code Cherry-Pick} command with all the options and
* parameters collected by the setter methods (e.g. {@link #include(Ref)} of
* this class. Each instance of this class should only be used for one
* invocation of the command. Don't call this method twice on an instance.
*
* @return the result of the cherry-pick
* @throws GitAPIException
* @throws WrongRepositoryStateException
* @throws ConcurrentRefUpdateException
* @throws UnmergedPathsException
* @throws NoMessageException
* @throws NoHeadException
*/
@Override
public CherryPickResult call() throws GitAPIException, NoMessageException,
@ -224,6 +221,8 @@ private RevCommit getParentCommit(RevCommit srcCommit, RevWalk revWalk)
}
/**
* Include a reference to a commit
*
* @param commit
* a reference to a commit which is cherry-picked to the current
* head
@ -236,6 +235,8 @@ public CherryPickCommand include(Ref commit) {
}
/**
* Include a commit
*
* @param commit
* the Id of a commit which is cherry-picked to the current head
* @return {@code this}
@ -245,6 +246,8 @@ public CherryPickCommand include(AnyObjectId commit) {
}
/**
* Include a commit
*
* @param name
* a name given to the commit
* @param commit
@ -257,6 +260,8 @@ public CherryPickCommand include(String name, AnyObjectId commit) {
}
/**
* Set the name that should be used in the "OURS" place for conflict markers
*
* @param ourCommitName
* the name that should be used in the "OURS" place for conflict
* markers
@ -284,6 +289,8 @@ public CherryPickCommand setReflogPrefix(final String prefix) {
}
/**
* Set the {@code MergeStrategy}
*
* @param strategy
* The merge strategy to use during this Cherry-pick.
* @return {@code this}
@ -295,6 +302,8 @@ public CherryPickCommand setStrategy(MergeStrategy strategy) {
}
/**
* Set the (1-based) parent number to diff against
*
* @param mainlineParentNumber
* the (1-based) parent number to diff against. This allows
* cherry-picking of merges.
@ -332,6 +341,7 @@ private String calculateOurName(Ref headRef) {
return headName;
}
/** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {

View File

@ -46,12 +46,11 @@
import java.util.Map;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.merge.ResolveMerger;
import org.eclipse.jgit.merge.ResolveMerger.MergeFailureReason;
import org.eclipse.jgit.revwalk.RevCommit;
/**
* Encapsulates the result of a {@link CherryPickCommand}.
* Encapsulates the result of a {@link org.eclipse.jgit.api.CherryPickCommand}.
*/
public class CherryPickResult {
@ -91,6 +90,8 @@ public String toString() {
private final Map<String, MergeFailureReason> failingPaths;
/**
* Constructor for CherryPickResult
*
* @param newHead
* commit the head points at after this cherry-pick
* @param cherryPickedRefs
@ -104,9 +105,12 @@ public CherryPickResult(RevCommit newHead, List<Ref> cherryPickedRefs) {
}
/**
* Constructor for CherryPickResult
*
* @param failingPaths
* list of paths causing this cherry-pick to fail (see
* {@link ResolveMerger#getFailingPaths()} for details)
* {@link org.eclipse.jgit.merge.ResolveMerger#getFailingPaths()}
* for details)
*/
public CherryPickResult(Map<String, MergeFailureReason> failingPaths) {
this.status = CherryPickStatus.FAILED;
@ -130,6 +134,8 @@ private CherryPickResult(CherryPickStatus status) {
CherryPickStatus.CONFLICTING);
/**
* Get status
*
* @return the status this cherry-pick resulted in
*/
public CherryPickStatus getStatus() {
@ -137,28 +143,34 @@ public CherryPickStatus getStatus() {
}
/**
* Get the new head after this cherry-pick
*
* @return the commit the head points at after this cherry-pick,
* <code>null</code> if {@link #getStatus} is not
* {@link CherryPickStatus#OK}
* {@link org.eclipse.jgit.api.CherryPickResult.CherryPickStatus#OK}
*/
public RevCommit getNewHead() {
return newHead;
}
/**
* Get the cherry-picked {@code Ref}s
*
* @return the list of successfully cherry-picked <code>Ref</code>'s,
* <code>null</code> if {@link #getStatus} is not
* {@link CherryPickStatus#OK}
* {@link org.eclipse.jgit.api.CherryPickResult.CherryPickStatus#OK}
*/
public List<Ref> getCherryPickedRefs() {
return cherryPickedRefs;
}
/**
* Get the list of paths causing this cherry-pick to fail
*
* @return the list of paths causing this cherry-pick to fail (see
* {@link ResolveMerger#getFailingPaths()} for details),
* <code>null</code> if {@link #getStatus} is not
* {@link CherryPickStatus#FAILED}
* {@link org.eclipse.jgit.merge.ResolveMerger#getFailingPaths()}
* for details), <code>null</code> if {@link #getStatus} is not
* {@link org.eclipse.jgit.api.CherryPickResult.CherryPickStatus#FAILED}
*/
public Map<String, MergeFailureReason> getFailingPaths() {
return failingPaths;

View File

@ -79,21 +79,22 @@ public class CleanCommand extends GitCommand<Set<String>> {
private boolean force = false;
/**
* Constructor for CleanCommand
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
protected CleanCommand(Repository repo) {
super(repo);
}
/**
* {@inheritDoc}
* <p>
* Executes the {@code clean} command with all the options and parameters
* collected by the setter methods of this class. Each instance of this
* class should only be used for one invocation of the command (means: one
* call to {@link #call()})
*
* @return a set of strings representing each file cleaned.
* @throws GitAPIException
* @throws NoWorkTreeException
*/
@Override
public Set<String> call() throws NoWorkTreeException, GitAPIException {

View File

@ -167,6 +167,8 @@ File getDirectory() {
}
/**
* {@inheritDoc}
* <p>
* Executes the {@code Clone} command.
*
* The Git instance returned by this command needs to be closed by the
@ -174,11 +176,6 @@ File getDirectory() {
* instance. It is recommended to call this method as soon as you don't need
* a reference to this {@link Git} instance and the underlying
* {@link Repository} instance anymore.
*
* @return the newly created {@code Git} object with associated repository
* @throws InvalidRemoteException
* @throws org.eclipse.jgit.api.errors.TransportException
* @throws GitAPIException
*/
@Override
public Git call() throws GitAPIException, InvalidRemoteException,
@ -450,9 +447,11 @@ private RevCommit parseCommit(final Repository clonedRepo, final Ref ref)
}
/**
* Set the URI to clone from
*
* @param uri
* the URI to clone from, or {@code null} to unset the URI.
* The URI must be set before {@link #call} is called.
* the URI to clone from, or {@code null} to unset the URI. The
* URI must be set before {@link #call} is called.
* @return this instance
*/
public CloneCommand setURI(String uri) {
@ -465,12 +464,11 @@ public CloneCommand setURI(String uri) {
* directory isn't set, a name associated with the source uri will be used.
*
* @see URIish#getHumanishName()
*
* @param directory
* the directory to clone to, or {@code null} if the directory
* name should be taken from the source uri
* @return this instance
* @throws IllegalStateException
* @throws java.lang.IllegalStateException
* if the combination of directory, gitDir and bare is illegal.
* E.g. if for a non-bare repository directory and gitDir point
* to the same directory of if for a bare repository both
@ -483,11 +481,13 @@ public CloneCommand setDirectory(File directory) {
}
/**
* Set the repository meta directory (.git)
*
* @param gitDir
* the repository meta directory, or {@code null} to choose one
* automatically at clone time
* @return this instance
* @throws IllegalStateException
* @throws java.lang.IllegalStateException
* if the combination of directory, gitDir and bare is illegal.
* E.g. if for a non-bare repository directory and gitDir point
* to the same directory of if for a bare repository both
@ -501,10 +501,12 @@ public CloneCommand setGitDir(File gitDir) {
}
/**
* Set whether the cloned repository shall be bare
*
* @param bare
* whether the cloned repository is bare or not
* @return this instance
* @throws IllegalStateException
* @throws java.lang.IllegalStateException
* if the combination of directory, gitDir and bare is illegal.
* E.g. if for a non-bare repository directory and gitDir point
* to the same directory of if for a bare repository both
@ -536,13 +538,15 @@ public CloneCommand setRemote(String remote) {
}
/**
* Set the initial branch
*
* @param branch
* the initial branch to check out when cloning the repository.
* Can be specified as ref name (<code>refs/heads/master</code>),
* branch name (<code>master</code>) or tag name (<code>v1.2.3</code>).
* The default is to use the branch pointed to by the cloned
* repository's HEAD and can be requested by passing {@code null}
* or <code>HEAD</code>.
* branch name (<code>master</code>) or tag name
* (<code>v1.2.3</code>). The default is to use the branch
* pointed to by the cloned repository's HEAD and can be
* requested by passing {@code null} or <code>HEAD</code>.
* @return this instance
*/
public CloneCommand setBranch(String branch) {
@ -558,8 +562,8 @@ public CloneCommand setBranch(String branch) {
* this is set to <code>NullProgressMonitor</code>
*
* @see NullProgressMonitor
*
* @param monitor
* a {@link org.eclipse.jgit.lib.ProgressMonitor}
* @return {@code this}
*/
public CloneCommand setProgressMonitor(ProgressMonitor monitor) {
@ -571,6 +575,8 @@ public CloneCommand setProgressMonitor(ProgressMonitor monitor) {
}
/**
* Set whether all branches have to be fetched
*
* @param cloneAllBranches
* true when all branches have to be fetched (indicates wildcard
* in created fetch refspec), false otherwise.
@ -582,6 +588,8 @@ public CloneCommand setCloneAllBranches(boolean cloneAllBranches) {
}
/**
* Set whether to clone submodules
*
* @param cloneSubmodules
* true to initialize and update submodules. Ignored when
* {@link #setBare(boolean)} is set to true.
@ -593,6 +601,8 @@ public CloneCommand setCloneSubmodules(boolean cloneSubmodules) {
}
/**
* Set branches to clone
*
* @param branchesToClone
* collection of branches to clone. Ignored when allSelected is
* true. Must be specified as full ref names (e.g.
@ -605,6 +615,8 @@ public CloneCommand setBranchesToClone(Collection<String> branchesToClone) {
}
/**
* Set whether to skip checking out a branch
*
* @param noCheckout
* if set to <code>true</code> no branch will be checked out
* after the clone. This enhances performance of the clone

View File

@ -140,33 +140,22 @@ public class CommitCommand extends GitCommand<RevCommit> {
private Boolean allowEmpty;
/**
* Constructor for CommitCommand
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
protected CommitCommand(Repository repo) {
super(repo);
}
/**
* {@inheritDoc}
* <p>
* Executes the {@code commit} command with all the options and parameters
* collected by the setter methods of this class. Each instance of this
* class should only be used for one invocation of the command (means: one
* call to {@link #call()})
*
* @return a {@link RevCommit} object representing the successful commit.
* @throws NoHeadException
* when called on a git repo without a HEAD reference
* @throws NoMessageException
* when called without specifying a commit message
* @throws UnmergedPathsException
* when the current index contained unmerged paths (conflicts)
* @throws ConcurrentRefUpdateException
* when HEAD or branch ref is updated concurrently by someone
* else
* @throws WrongRepositoryStateException
* when repository is not in the right state for committing
* @throws AbortedByHookException
* if there are either pre-commit or commit-msg hooks present in
* the repository and one of them rejects the commit.
*/
@Override
public RevCommit call() throws GitAPIException, NoHeadException,
@ -602,6 +591,8 @@ private boolean isMergeDuringRebase(RepositoryState state) {
}
/**
* Set the commit message
*
* @param message
* the commit message used for the {@code commit}
* @return {@code this}
@ -613,6 +604,8 @@ public CommitCommand setMessage(String message) {
}
/**
* Set whether to allow to create an empty commit
*
* @param allowEmpty
* whether it should be allowed to create a commit which has the
* same tree as it's sole predecessor (a commit which doesn't
@ -623,8 +616,9 @@ public CommitCommand setMessage(String message) {
* <p>
* By default when creating a commit containing only specified
* paths an attempt to create an empty commit leads to a
* {@link JGitInternalException}. By setting this flag to
* <code>true</code> this exception will not be thrown.
* {@link org.eclipse.jgit.api.errors.JGitInternalException}. By
* setting this flag to <code>true</code> this exception will not
* be thrown.
* @return {@code this}
* @since 4.2
*/
@ -634,6 +628,8 @@ public CommitCommand setAllowEmpty(boolean allowEmpty) {
}
/**
* Get the commit message
*
* @return the commit message used for the <code>commit</code>
*/
public String getMessage() {
@ -673,10 +669,12 @@ public CommitCommand setCommitter(String name, String email) {
}
/**
* Get the committer
*
* @return the committer used for the {@code commit}. If no committer was
* specified {@code null} is returned and the default
* {@link PersonIdent} of this repo is used during execution of the
* command
* {@link org.eclipse.jgit.lib.PersonIdent} of this repo is used
* during execution of the command
*/
public PersonIdent getCommitter() {
return committer;
@ -715,10 +713,12 @@ public CommitCommand setAuthor(String name, String email) {
}
/**
* Get the author
*
* @return the author used for the {@code commit}. If no author was
* specified {@code null} is returned and the default
* {@link PersonIdent} of this repo is used during execution of the
* command
* {@link org.eclipse.jgit.lib.PersonIdent} of this repo is used
* during execution of the command
*/
public PersonIdent getAuthor() {
return author;
@ -730,6 +730,8 @@ public PersonIdent getAuthor() {
* not affected. This corresponds to the parameter -a on the command line.
*
* @param all
* whether to auto-stage all files that have been modified and
* deleted
* @return {@code this}
* @throws JGitInternalException
* in case of an illegal combination of arguments/ options
@ -745,11 +747,12 @@ public CommitCommand setAll(boolean all) {
}
/**
* Used to amend the tip of the current branch. If set to true, the previous
* commit will be amended. This is equivalent to --amend on the command
* line.
* Used to amend the tip of the current branch. If set to {@code true}, the
* previous commit will be amended. This is equivalent to --amend on the
* command line.
*
* @param amend
* whether to ammend the tip of the current branch
* @return {@code this}
*/
public CommitCommand setAmend(boolean amend) {
@ -790,7 +793,7 @@ public CommitCommand setOnly(String only) {
* will be replaced by the change id.
*
* @param insertChangeId
*
* whether to insert a change id
* @return {@code this}
*/
public CommitCommand setInsertChangeId(boolean insertChangeId) {

View File

@ -103,23 +103,16 @@ public enum SetupUpstreamMode {
}
/**
* Constructor for CreateBranchCommand
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
protected CreateBranchCommand(Repository repo) {
super(repo);
}
/**
* @throws RefAlreadyExistsException
* when trying to create (without force) a branch with a name
* that already exists
* @throws RefNotFoundException
* if the start point can not be found
* @throws InvalidRefNameException
* if the provided name is <code>null</code> or otherwise
* invalid
* @return the newly created branch
*/
/** {@inheritDoc} */
@Override
public Ref call() throws GitAPIException, RefAlreadyExistsException,
RefNotFoundException, InvalidRefNameException {
@ -297,6 +290,8 @@ private void processOptions() throws InvalidRefNameException {
}
/**
* Set the name of the new branch
*
* @param name
* the name of the new branch
* @return this instance
@ -308,6 +303,8 @@ public CreateBranchCommand setName(String name) {
}
/**
* Set whether to create the branch forcefully
*
* @param force
* if <code>true</code> and the branch with the given name
* already exists, the start-point of an existing branch will be
@ -322,6 +319,8 @@ public CreateBranchCommand setForce(boolean force) {
}
/**
* Set the start point
*
* @param startPoint
* corresponds to the start-point option; if <code>null</code>,
* the current HEAD will be used
@ -335,6 +334,8 @@ public CreateBranchCommand setStartPoint(String startPoint) {
}
/**
* Set the start point
*
* @param startPoint
* corresponds to the start-point option; if <code>null</code>,
* the current HEAD will be used
@ -348,6 +349,8 @@ public CreateBranchCommand setStartPoint(RevCommit startPoint) {
}
/**
* Set the upstream mode
*
* @param mode
* corresponds to the --track/--no-track/--set-upstream options;
* may be <code>null</code>

View File

@ -84,19 +84,16 @@ public class DeleteBranchCommand extends GitCommand<List<String>> {
private boolean force;
/**
* Constructor for DeleteBranchCommand
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
protected DeleteBranchCommand(Repository repo) {
super(repo);
}
/**
* @throws NotMergedException
* when trying to delete a branch which has not been merged into
* the currently checked out branch without force
* @throws CannotDeleteCurrentBranchException
* @return the list with the (full) names of the deleted branches
*/
/** {@inheritDoc} */
@Override
public List<String> call() throws GitAPIException,
NotMergedException, CannotDeleteCurrentBranchException {
@ -181,6 +178,8 @@ public List<String> call() throws GitAPIException,
}
/**
* Set the names of the branches to delete
*
* @param branchnames
* the names of the branches to delete; if not set, this will do
* nothing; invalid branch names will simply be ignored
@ -195,6 +194,8 @@ public DeleteBranchCommand setBranchNames(String... branchnames) {
}
/**
* Set whether to forcefully delete branches
*
* @param force
* <code>true</code> corresponds to the -D option,
* <code>false</code> to the -d option (default) <br>

View File

@ -71,15 +71,16 @@ public class DeleteTagCommand extends GitCommand<List<String>> {
private final Set<String> tags = new HashSet<>();
/**
* Constructor for DeleteTagCommand
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
protected DeleteTagCommand(Repository repo) {
super(repo);
}
/**
* @return the list with the full names of the deleted tags
*/
/** {@inheritDoc} */
@Override
public List<String> call() throws GitAPIException {
checkCallable();
@ -124,6 +125,8 @@ public List<String> call() throws GitAPIException {
}
/**
* Set names of the tags to delete
*
* @param tags
* the names of the tags to delete; if not set, this will do
* nothing; invalid tag names will simply be ignored

View File

@ -104,8 +104,10 @@ public class DescribeCommand extends GitCommand<String> {
private List<IMatcher> matchers = new ArrayList<>();
/**
* Constructor for DescribeCommand.
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
protected DescribeCommand(Repository repo) {
super(repo);
@ -123,7 +125,7 @@ protected DescribeCommand(Repository repo) {
* the supplied commit does not exist.
* @throws IncorrectObjectTypeException
* the supplied id is not a commit or an annotated tag.
* @throws IOException
* @throws java.io.IOException
* a pack file or loose object could not be read.
*/
public DescribeCommand setTarget(ObjectId target) throws IOException {
@ -135,14 +137,15 @@ public DescribeCommand setTarget(ObjectId target) throws IOException {
* Sets the commit to be described.
*
* @param rev
* Commit ID, tag, branch, ref, etc.
* See {@link Repository#resolve(String)} for allowed syntax.
* Commit ID, tag, branch, ref, etc. See
* {@link org.eclipse.jgit.lib.Repository#resolve(String)} for
* allowed syntax.
* @return {@code this}
* @throws IncorrectObjectTypeException
* the supplied id is not a commit or an annotated tag.
* @throws RefNotFoundException
* the given rev didn't resolve to any object.
* @throws IOException
* @throws org.eclipse.jgit.api.errors.RefNotFoundException
* the given rev didn't resolve to any object.
* @throws java.io.IOException
* a pack file or loose object could not be read.
*/
public DescribeCommand setTarget(String rev) throws IOException,
@ -160,7 +163,6 @@ public DescribeCommand setTarget(String rev) throws IOException,
* @param longDesc
* <code>true</code> if always the long format should be used.
* @return {@code this}
*
* @see <a
* href="https://www.kernel.org/pub/software/scm/git/docs/git-describe.html"
* >Git documentation about describe</a>
@ -180,15 +182,17 @@ private String longDescription(Ref tag, int depth, ObjectId tip)
}
/**
* Sets one or more {@code glob(7)} patterns that tags must match to be considered.
* If multiple patterns are provided, tags only need match one of them.
* Sets one or more {@code glob(7)} patterns that tags must match to be
* considered. If multiple patterns are provided, tags only need match one
* of them.
*
* @param patterns the {@code glob(7)} pattern or patterns
* @param patterns
* the {@code glob(7)} pattern or patterns
* @return {@code this}
* @throws InvalidPatternException if the pattern passed in was invalid.
*
* @see <a
* href="https://www.kernel.org/pub/software/scm/git/docs/git-describe.html"
* @throws org.eclipse.jgit.errors.InvalidPatternException
* if the pattern passed in was invalid.
* @see <a href=
* "https://www.kernel.org/pub/software/scm/git/docs/git-describe.html"
* >Git documentation about describe</a>
* @since 4.9
*/
@ -229,16 +233,10 @@ private ObjectId getObjectIdFromRef(Ref r) {
}
/**
* {@inheritDoc}
* <p>
* Describes the specified commit. Target defaults to HEAD if no commit was
* set explicitly.
*
* @return if there's a tag that points to the commit being described, this
* tag name is returned. Otherwise additional suffix is added to the
* nearest tag, just like git-describe(1).
* <p>
* If none of the ancestors of the commit being described has any
* tags at all, then this method returns null, indicating that
* there's no way to describe this tag.
*/
@Override
public String call() throws GitAPIException {

View File

@ -95,19 +95,22 @@ public class DiffCommand extends GitCommand<List<DiffEntry>> {
private ProgressMonitor monitor = NullProgressMonitor.INSTANCE;
/**
* Constructor for DiffCommand
*
* @param repo
* a {@link org.eclipse.jgit.lib.Repository} object.
*/
protected DiffCommand(Repository repo) {
super(repo);
}
/**
* {@inheritDoc}
* <p>
* Executes the {@code Diff} command with all the options and parameters
* collected by the setter methods (e.g. {@link #setCached(boolean)} of this
* class. Each instance of this class should only be used for one invocation
* of the command. Don't call this method twice on an instance.
*
* @return a DiffEntry for each path which is different
*/
@Override
public List<DiffEntry> call() throws GitAPIException {
@ -162,9 +165,10 @@ public List<DiffEntry> call() throws GitAPIException {
}
/**
* Whether to view the changes staged for the next commit
*
* @param cached
* whether to view the changes you staged for the next commit
* whether to view the changes staged for the next commit
* @return this instance
*/
public DiffCommand setCached(boolean cached) {
@ -173,6 +177,8 @@ public DiffCommand setCached(boolean cached) {
}
/**
* Set path filter
*
* @param pathFilter
* parameter, used to limit the diff to the named path
* @return this instance
@ -183,6 +189,8 @@ public DiffCommand setPathFilter(TreeFilter pathFilter) {
}
/**
* Set old tree
*
* @param oldTree
* the previous state
* @return this instance
@ -193,6 +201,8 @@ public DiffCommand setOldTree(AbstractTreeIterator oldTree) {
}
/**
* Set new tree
*
* @param newTree
* the updated state
* @return this instance
@ -203,6 +213,8 @@ public DiffCommand setNewTree(AbstractTreeIterator newTree) {
}
/**
* Set whether to return only names and status of changed files
*
* @param showNameAndStatusOnly
* whether to return only names and status of changed files
* @return this instance
@ -213,6 +225,8 @@ public DiffCommand setShowNameAndStatusOnly(boolean showNameAndStatusOnly) {
}
/**
* Set output stream
*
* @param out
* the stream to write line data
* @return this instance
@ -263,7 +277,6 @@ public DiffCommand setDestinationPrefix(String destinationPrefix) {
* is set to <code>NullProgressMonitor</code>
*
* @see NullProgressMonitor
*
* @param monitor
* a progress monitor
* @return this instance

View File

@ -122,7 +122,10 @@ public interface Callback {
}
/**
* Constructor for FetchCommand.
*
* @param repo
* a {@link org.eclipse.jgit.lib.Repository} object.
*/
protected FetchCommand(Repository repo) {
super(repo);
@ -210,17 +213,12 @@ private void fetchSubmodules(FetchResult results)
}
/**
* Executes the {@code fetch} command with all the options and parameters
* {@inheritDoc}
* <p>
* Execute the {@code fetch} command with all the options and parameters
* collected by the setter methods of this class. Each instance of this
* class should only be used for one invocation of the command (means: one
* call to {@link #call()})
*
* @return a {@link FetchResult} object representing the successful fetch
* result
* @throws InvalidRemoteException
* when called with an invalid remote uri
* @throws org.eclipse.jgit.api.errors.TransportException
* when an error occurs during transport
*/
@Override
public FetchResult call() throws GitAPIException, InvalidRemoteException,
@ -288,6 +286,7 @@ public FetchCommand setRecurseSubmodules(
*
* @see Constants#DEFAULT_REMOTE_NAME
* @param remote
* name of a remote
* @return {@code this}
*/
public FetchCommand setRemote(String remote) {
@ -297,6 +296,8 @@ public FetchCommand setRemote(String remote) {
}
/**
* Get the remote
*
* @return the remote used for the remote operation
*/
public String getRemote() {
@ -304,6 +305,8 @@ public String getRemote() {
}
/**
* Get timeout
*
* @return the timeout used for the fetch operation
*/
public int getTimeout() {
@ -311,16 +314,19 @@ public int getTimeout() {
}
/**
* @return whether to check received objects checked for validity
* Whether to check received objects for validity
*
* @return whether to check received objects for validity
*/
public boolean isCheckFetchedObjects() {
return checkFetchedObjects;
}
/**
* If set to true, objects received will be checked for validity
* If set to {@code true}, objects received will be checked for validity
*
* @param checkFetchedObjects
* whether to check objects for validity
* @return {@code this}
*/
public FetchCommand setCheckFetchedObjects(boolean checkFetchedObjects) {
@ -330,7 +336,9 @@ public FetchCommand setCheckFetchedObjects(boolean checkFetchedObjects) {
}
/**
* @return whether or not to remove refs which no longer exist in the source
* Whether to remove refs which no longer exist in the source
*
* @return whether to remove refs which no longer exist in the source
*/
public boolean isRemoveDeletedRefs() {
if (removeDeletedRefs != null)
@ -347,9 +355,11 @@ public boolean isRemoveDeletedRefs() {
}
/**
* If set to true, refs are removed which no longer exist in the source
* If set to {@code true}, refs are removed which no longer exist in the
* source
*
* @param removeDeletedRefs
* whether to remove deleted {@code Ref}s
* @return {@code this}
*/
public FetchCommand setRemoveDeletedRefs(boolean removeDeletedRefs) {
@ -359,6 +369,8 @@ public FetchCommand setRemoveDeletedRefs(boolean removeDeletedRefs) {
}
/**
* Get progress monitor
*
* @return the progress monitor for the fetch operation
*/
public ProgressMonitor getProgressMonitor() {
@ -370,8 +382,8 @@ public ProgressMonitor getProgressMonitor() {
* this is set to <code>NullProgressMonitor</code>
*
* @see NullProgressMonitor
*
* @param monitor
* a {@link org.eclipse.jgit.lib.ProgressMonitor}
* @return {@code this}
*/
public FetchCommand setProgressMonitor(ProgressMonitor monitor) {
@ -384,6 +396,8 @@ public FetchCommand setProgressMonitor(ProgressMonitor monitor) {
}
/**
* Get list of {@code RefSpec}s
*
* @return the ref specs
*/
public List<RefSpec> getRefSpecs() {
@ -394,6 +408,7 @@ public List<RefSpec> getRefSpecs() {
* The ref specs to be used in the fetch operation
*
* @param specs
* String representation of {@code RefSpec}s
* @return {@code this}
* @since 4.9
*/
@ -406,6 +421,7 @@ public FetchCommand setRefSpecs(String... specs) {
* The ref specs to be used in the fetch operation
*
* @param specs
* one or multiple {@link org.eclipse.jgit.transport.RefSpec}s
* @return {@code this}
*/
public FetchCommand setRefSpecs(RefSpec... specs) {
@ -416,6 +432,7 @@ public FetchCommand setRefSpecs(RefSpec... specs) {
* The ref specs to be used in the fetch operation
*
* @param specs
* list of {@link org.eclipse.jgit.transport.RefSpec}s
* @return {@code this}
*/
public FetchCommand setRefSpecs(List<RefSpec> specs) {
@ -426,6 +443,8 @@ public FetchCommand setRefSpecs(List<RefSpec> specs) {
}
/**
* Whether to do a dry run
*
* @return the dry run preference for the fetch operation
*/
public boolean isDryRun() {
@ -436,6 +455,7 @@ public boolean isDryRun() {
* Sets whether the fetch operation should be a dry run
*
* @param dryRun
* whether to do a dry run
* @return {@code this}
*/
public FetchCommand setDryRun(boolean dryRun) {
@ -445,6 +465,8 @@ public FetchCommand setDryRun(boolean dryRun) {
}
/**
* Get thin-pack preference
*
* @return the thin-pack preference for fetch operation
*/
public boolean isThin() {
@ -457,6 +479,7 @@ public boolean isThin() {
* Default setting is Transport.DEFAULT_FETCH_THIN
*
* @param thin
* the thin-pack preference
* @return {@code this}
*/
public FetchCommand setThin(boolean thin) {
@ -469,6 +492,7 @@ public FetchCommand setThin(boolean thin) {
* Sets the specification of annotated tag behavior during fetch
*
* @param tagOpt
* the {@link org.eclipse.jgit.transport.TagOpt}
* @return {@code this}
*/
public FetchCommand setTagOpt(TagOpt tagOpt) {

View File

@ -61,7 +61,6 @@
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.StoredConfig;
import org.eclipse.jgit.storage.pack.PackConfig;
import org.eclipse.jgit.util.GitDateParser;
/**
* A class used to execute a {@code gc} command. It has setters for all
@ -97,7 +96,10 @@ public class GarbageCollectCommand extends GitCommand<Properties> {
private PackConfig pconfig;
/**
* Constructor for GarbageCollectCommand.
*
* @param repo
* a {@link org.eclipse.jgit.lib.Repository} object.
*/
protected GarbageCollectCommand(Repository repo) {
super(repo);
@ -105,6 +107,8 @@ protected GarbageCollectCommand(Repository repo) {
}
/**
* Set progress monitor
*
* @param monitor
* a progress monitor
* @return this instance
@ -118,8 +122,8 @@ public GarbageCollectCommand setProgressMonitor(ProgressMonitor monitor) {
* During gc() or prune() each unreferenced, loose object which has been
* created or modified after <code>expire</code> will not be pruned. Only
* older objects may be pruned. If set to null then every object is a
* candidate for pruning. Use {@link GitDateParser} to parse time formats
* used by git gc.
* candidate for pruning. Use {@link org.eclipse.jgit.util.GitDateParser} to
* parse time formats used by git gc.
*
* @param expire
* minimal age of objects to be pruned.
@ -191,6 +195,7 @@ public GarbageCollectCommand setPrunePreserved(boolean prunePreserved) {
return this;
}
/** {@inheritDoc} */
@Override
public Properties call() throws GitAPIException {
checkCallable();
@ -229,7 +234,7 @@ public Properties call() throws GitAPIException {
* Computes and returns the repository statistics.
*
* @return the repository statistics
* @throws GitAPIException
* @throws org.eclipse.jgit.api.errors.GitAPIException
* thrown if the repository statistics cannot be computed
* @since 3.0
*/

View File

@ -89,25 +89,30 @@ public class Git implements AutoCloseable {
private final boolean closeRepo;
/**
* Open repository
*
* @param dir
* the repository to open. May be either the GIT_DIR, or the
* working tree directory that contains {@code .git}.
* @return a {@link Git} object for the existing git repository
* @throws IOException
* @return a {@link org.eclipse.jgit.api.Git} object for the existing git
* repository
* @throws java.io.IOException
*/
public static Git open(File dir) throws IOException {
return open(dir, FS.DETECTED);
}
/**
* Open repository
*
* @param dir
* the repository to open. May be either the GIT_DIR, or the
* working tree directory that contains {@code .git}.
* @param fs
* filesystem abstraction to use when accessing the repository.
* @return a {@link Git} object for the existing git repository. Closing this
* instance will close the repo.
* @throws IOException
* @return a {@link org.eclipse.jgit.api.Git} object for the existing git
* repository. Closing this instance will close the repo.
* @throws java.io.IOException
*/
public static Git open(File dir, FS fs) throws IOException {
RepositoryCache.FileKey key;
@ -119,31 +124,36 @@ public static Git open(File dir, FS fs) throws IOException {
}
/**
* Wrap repository
*
* @param repo
* the git repository this class is interacting with;
* {@code null} is not allowed.
* @return a {@link Git} object for the existing git repository. The caller is
* responsible for closing the repository; {@link #close()} on this
* instance does not close the repo.
* @return a {@link org.eclipse.jgit.api.Git} object for the existing git
* repository. The caller is responsible for closing the repository;
* {@link #close()} on this instance does not close the repo.
*/
public static Git wrap(Repository repo) {
return new Git(repo);
}
/**
* Frees resources associated with this instance.
* {@inheritDoc}
* <p>
* If the repository was opened by a static factory method in this class, then
* this method calls {@link Repository#close()} on the underlying repository
* instance. (Whether this actually releases underlying resources, such as
* file handles, may vary; see {@link Repository} for more details.)
* Free resources associated with this instance.
* <p>
* If the repository was created by a caller and passed into {@link
* #Git(Repository)} or a static factory method in this class, then this
* method does not call close on the underlying repository.
* If the repository was opened by a static factory method in this class,
* then this method calls {@link Repository#close()} on the underlying
* repository instance. (Whether this actually releases underlying
* resources, such as file handles, may vary; see {@link Repository} for
* more details.)
* <p>
* In all cases, after calling this method you should not use this {@link Git}
* instance anymore.
* If the repository was created by a caller and passed into
* {@link #Git(Repository)} or a static factory method in this class, then
* this method does not call close on the underlying repository.
* <p>
* In all cases, after calling this method you should not use this
* {@link Git} instance anymore.
*
* @since 3.2
*/
@ -154,23 +164,23 @@ public void close() {
}
/**
* Returns a command object to execute a {@code clone} command
* Return a command object to execute a {@code clone} command
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-clone.html"
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-clone.html"
* >Git documentation about clone</a>
* @return a {@link CloneCommand} used to collect all optional parameters
* and to finally execute the {@code clone} command
* @return a {@link org.eclipse.jgit.api.CloneCommand} used to collect all
* optional parameters and to finally execute the {@code clone}
* command
*/
public static CloneCommand cloneRepository() {
return new CloneCommand();
}
/**
* Returns a command to list remote branches/tags without a local
* repository.
* Return a command to list remote branches/tags without a local repository.
*
* @return a {@link LsRemoteCommand}
* @return a {@link org.eclipse.jgit.api.LsRemoteCommand}
* @since 3.1
*/
public static LsRemoteCommand lsRemoteRepository() {
@ -178,24 +188,25 @@ public static LsRemoteCommand lsRemoteRepository() {
}
/**
* Returns a command object to execute a {@code init} command
* Return a command object to execute a {@code init} command
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-init.html"
* >Git documentation about init</a>
* @return a {@link InitCommand} used to collect all optional parameters and
* to finally execute the {@code init} command
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-init.html" >Git
* documentation about init</a>
* @return a {@link org.eclipse.jgit.api.InitCommand} used to collect all
* optional parameters and to finally execute the {@code init}
* command
*/
public static InitCommand init() {
return new InitCommand();
}
/**
* Constructs a new {@link Git} object which can interact with the specified
* git repository.
* Construct a new {@link org.eclipse.jgit.api.Git} object which can
* interact with the specified git repository.
* <p>
* All command classes returned by methods of this class will always interact
* with this git repository.
* All command classes returned by methods of this class will always
* interact with this git repository.
* <p>
* The caller is responsible for closing the repository; {@link #close()} on
* this instance does not close the repo.
@ -216,75 +227,78 @@ public Git(Repository repo) {
}
/**
* Returns a command object to execute a {@code Commit} command
* Return a command object to execute a {@code Commit} command
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-commit.html"
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-commit.html"
* >Git documentation about Commit</a>
* @return a {@link CommitCommand} used to collect all optional parameters
* and to finally execute the {@code Commit} command
* @return a {@link org.eclipse.jgit.api.CommitCommand} used to collect all
* optional parameters and to finally execute the {@code Commit}
* command
*/
public CommitCommand commit() {
return new CommitCommand(repo);
}
/**
* Returns a command object to execute a {@code Log} command
* Return a command object to execute a {@code Log} command
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-log.html"
* >Git documentation about Log</a>
* @return a {@link LogCommand} used to collect all optional parameters and
* to finally execute the {@code Log} command
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-log.html" >Git
* documentation about Log</a>
* @return a {@link org.eclipse.jgit.api.LogCommand} used to collect all
* optional parameters and to finally execute the {@code Log}
* command
*/
public LogCommand log() {
return new LogCommand(repo);
}
/**
* Returns a command object to execute a {@code Merge} command
* Return a command object to execute a {@code Merge} command
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-merge.html"
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-merge.html"
* >Git documentation about Merge</a>
* @return a {@link MergeCommand} used to collect all optional parameters
* and to finally execute the {@code Merge} command
* @return a {@link org.eclipse.jgit.api.MergeCommand} used to collect all
* optional parameters and to finally execute the {@code Merge}
* command
*/
public MergeCommand merge() {
return new MergeCommand(repo);
}
/**
* Returns a command object to execute a {@code Pull} command
* Return a command object to execute a {@code Pull} command
*
* @return a {@link PullCommand}
* @return a {@link org.eclipse.jgit.api.PullCommand}
*/
public PullCommand pull() {
return new PullCommand(repo);
}
/**
* Returns a command object used to create branches
* Return a command object used to create branches
*
* @return a {@link CreateBranchCommand}
* @return a {@link org.eclipse.jgit.api.CreateBranchCommand}
*/
public CreateBranchCommand branchCreate() {
return new CreateBranchCommand(repo);
}
/**
* Returns a command object used to delete branches
* Return a command object used to delete branches
*
* @return a {@link DeleteBranchCommand}
* @return a {@link org.eclipse.jgit.api.DeleteBranchCommand}
*/
public DeleteBranchCommand branchDelete() {
return new DeleteBranchCommand(repo);
}
/**
* Returns a command object used to list branches
* Return a command object used to list branches
*
* @return a {@link ListBranchCommand}
* @return a {@link org.eclipse.jgit.api.ListBranchCommand}
*/
public ListBranchCommand branchList() {
return new ListBranchCommand(repo);
@ -292,170 +306,180 @@ public ListBranchCommand branchList() {
/**
*
* Returns a command object used to list tags
* Return a command object used to list tags
*
* @return a {@link ListTagCommand}
* @return a {@link org.eclipse.jgit.api.ListTagCommand}
*/
public ListTagCommand tagList() {
return new ListTagCommand(repo);
}
/**
* Returns a command object used to rename branches
* Return a command object used to rename branches
*
* @return a {@link RenameBranchCommand}
* @return a {@link org.eclipse.jgit.api.RenameBranchCommand}
*/
public RenameBranchCommand branchRename() {
return new RenameBranchCommand(repo);
}
/**
* Returns a command object to execute a {@code Add} command
* Return a command object to execute a {@code Add} command
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-add.html"
* >Git documentation about Add</a>
* @return a {@link AddCommand} used to collect all optional parameters and
* to finally execute the {@code Add} command
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-add.html" >Git
* documentation about Add</a>
* @return a {@link org.eclipse.jgit.api.AddCommand} used to collect all
* optional parameters and to finally execute the {@code Add}
* command
*/
public AddCommand add() {
return new AddCommand(repo);
}
/**
* Returns a command object to execute a {@code Tag} command
* Return a command object to execute a {@code Tag} command
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-tag.html"
* >Git documentation about Tag</a>
* @return a {@link TagCommand} used to collect all optional parameters and
* to finally execute the {@code Tag} command
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-tag.html" >Git
* documentation about Tag</a>
* @return a {@link org.eclipse.jgit.api.TagCommand} used to collect all
* optional parameters and to finally execute the {@code Tag}
* command
*/
public TagCommand tag() {
return new TagCommand(repo);
}
/**
* Returns a command object to execute a {@code Fetch} command
* Return a command object to execute a {@code Fetch} command
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-fetch.html"
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-fetch.html"
* >Git documentation about Fetch</a>
* @return a {@link FetchCommand} used to collect all optional parameters
* and to finally execute the {@code Fetch} command
* @return a {@link org.eclipse.jgit.api.FetchCommand} used to collect all
* optional parameters and to finally execute the {@code Fetch}
* command
*/
public FetchCommand fetch() {
return new FetchCommand(repo);
}
/**
* Returns a command object to execute a {@code Push} command
* Return a command object to execute a {@code Push} command
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-push.html"
* >Git documentation about Push</a>
* @return a {@link PushCommand} used to collect all optional parameters and
* to finally execute the {@code Push} command
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-push.html" >Git
* documentation about Push</a>
* @return a {@link org.eclipse.jgit.api.PushCommand} used to collect all
* optional parameters and to finally execute the {@code Push}
* command
*/
public PushCommand push() {
return new PushCommand(repo);
}
/**
* Returns a command object to execute a {@code cherry-pick} command
* Return a command object to execute a {@code cherry-pick} command
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-cherry-pick.html"
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-cherry-pick.html"
* >Git documentation about cherry-pick</a>
* @return a {@link CherryPickCommand} used to collect all optional
* parameters and to finally execute the {@code cherry-pick} command
* @return a {@link org.eclipse.jgit.api.CherryPickCommand} used to collect
* all optional parameters and to finally execute the
* {@code cherry-pick} command
*/
public CherryPickCommand cherryPick() {
return new CherryPickCommand(repo);
}
/**
* Returns a command object to execute a {@code revert} command
* Return a command object to execute a {@code revert} command
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-revert.html"
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-revert.html"
* >Git documentation about reverting changes</a>
* @return a {@link RevertCommand} used to collect all optional parameters
* and to finally execute the {@code cherry-pick} command
* @return a {@link org.eclipse.jgit.api.RevertCommand} used to collect all
* optional parameters and to finally execute the
* {@code cherry-pick} command
*/
public RevertCommand revert() {
return new RevertCommand(repo);
}
/**
* Returns a command object to execute a {@code Rebase} command
* Return a command object to execute a {@code Rebase} command
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-rebase.html"
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-rebase.html"
* >Git documentation about rebase</a>
* @return a {@link RebaseCommand} used to collect all optional parameters
* and to finally execute the {@code rebase} command
* @return a {@link org.eclipse.jgit.api.RebaseCommand} used to collect all
* optional parameters and to finally execute the {@code rebase}
* command
*/
public RebaseCommand rebase() {
return new RebaseCommand(repo);
}
/**
* Returns a command object to execute a {@code rm} command
* Return a command object to execute a {@code rm} command
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-rm.html"
* >Git documentation about rm</a>
* @return a {@link RmCommand} used to collect all optional parameters and
* to finally execute the {@code rm} command
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-rm.html" >Git
* documentation about rm</a>
* @return a {@link org.eclipse.jgit.api.RmCommand} used to collect all
* optional parameters and to finally execute the {@code rm} command
*/
public RmCommand rm() {
return new RmCommand(repo);
}
/**
* Returns a command object to execute a {@code checkout} command
* Return a command object to execute a {@code checkout} command
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-checkout.html"
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-checkout.html"
* >Git documentation about checkout</a>
* @return a {@link CheckoutCommand} used to collect all optional parameters
* and to finally execute the {@code checkout} command
* @return a {@link org.eclipse.jgit.api.CheckoutCommand} used to collect
* all optional parameters and to finally execute the
* {@code checkout} command
*/
public CheckoutCommand checkout() {
return new CheckoutCommand(repo);
}
/**
* Returns a command object to execute a {@code reset} command
* Return a command object to execute a {@code reset} command
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-reset.html"
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-reset.html"
* >Git documentation about reset</a>
* @return a {@link ResetCommand} used to collect all optional parameters
* and to finally execute the {@code reset} command
* @return a {@link org.eclipse.jgit.api.ResetCommand} used to collect all
* optional parameters and to finally execute the {@code reset}
* command
*/
public ResetCommand reset() {
return new ResetCommand(repo);
}
/**
* Returns a command object to execute a {@code status} command
* Return a command object to execute a {@code status} command
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-status.html"
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-status.html"
* >Git documentation about status</a>
* @return a {@link StatusCommand} used to collect all optional parameters
* and to finally execute the {@code status} command
* @return a {@link org.eclipse.jgit.api.StatusCommand} used to collect all
* optional parameters and to finally execute the {@code status}
* command
*/
public StatusCommand status() {
return new StatusCommand(repo);
}
/**
* Returns a command to create an archive from a tree
* Return a command to create an archive from a tree
*
* @return a {@link ArchiveCommand}
* @return a {@link org.eclipse.jgit.api.ArchiveCommand}
* @since 3.1
*/
public ArchiveCommand archive() {
@ -463,179 +487,185 @@ public ArchiveCommand archive() {
}
/**
* Returns a command to add notes to an object
* Return a command to add notes to an object
*
* @return a {@link AddNoteCommand}
* @return a {@link org.eclipse.jgit.api.AddNoteCommand}
*/
public AddNoteCommand notesAdd() {
return new AddNoteCommand(repo);
}
/**
* Returns a command to remove notes on an object
* Return a command to remove notes on an object
*
* @return a {@link RemoveNoteCommand}
* @return a {@link org.eclipse.jgit.api.RemoveNoteCommand}
*/
public RemoveNoteCommand notesRemove() {
return new RemoveNoteCommand(repo);
}
/**
* Returns a command to list all notes
* Return a command to list all notes
*
* @return a {@link ListNotesCommand}
* @return a {@link org.eclipse.jgit.api.ListNotesCommand}
*/
public ListNotesCommand notesList() {
return new ListNotesCommand(repo);
}
/**
* Returns a command to show notes on an object
* Return a command to show notes on an object
*
* @return a {@link ShowNoteCommand}
* @return a {@link org.eclipse.jgit.api.ShowNoteCommand}
*/
public ShowNoteCommand notesShow() {
return new ShowNoteCommand(repo);
}
/**
* Returns a command object to execute a {@code ls-remote} command
* Return a command object to execute a {@code ls-remote} command
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-ls-remote.html"
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-ls-remote.html"
* >Git documentation about ls-remote</a>
* @return a {@link LsRemoteCommand} used to collect all optional parameters
* and to finally execute the {@code status} command
* @return a {@link org.eclipse.jgit.api.LsRemoteCommand} used to collect
* all optional parameters and to finally execute the {@code status}
* command
*/
public LsRemoteCommand lsRemote() {
return new LsRemoteCommand(repo);
}
/**
* Returns a command object to execute a {@code clean} command
* Return a command object to execute a {@code clean} command
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-clean.html"
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-clean.html"
* >Git documentation about Clean</a>
* @return a {@link CleanCommand} used to collect all optional parameters
* and to finally execute the {@code clean} command
* @return a {@link org.eclipse.jgit.api.CleanCommand} used to collect all
* optional parameters and to finally execute the {@code clean}
* command
*/
public CleanCommand clean() {
return new CleanCommand(repo);
}
/**
* Returns a command object to execute a {@code blame} command
* Return a command object to execute a {@code blame} command
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-blame.html"
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-blame.html"
* >Git documentation about Blame</a>
* @return a {@link BlameCommand} used to collect all optional parameters
* and to finally execute the {@code blame} command
* @return a {@link org.eclipse.jgit.api.BlameCommand} used to collect all
* optional parameters and to finally execute the {@code blame}
* command
*/
public BlameCommand blame() {
return new BlameCommand(repo);
}
/**
* Returns a command object to execute a {@code reflog} command
* Return a command object to execute a {@code reflog} command
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-reflog.html"
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-reflog.html"
* >Git documentation about reflog</a>
* @return a {@link ReflogCommand} used to collect all optional parameters
* and to finally execute the {@code reflog} command
* @return a {@link org.eclipse.jgit.api.ReflogCommand} used to collect all
* optional parameters and to finally execute the {@code reflog}
* command
*/
public ReflogCommand reflog() {
return new ReflogCommand(repo);
}
/**
* Returns a command object to execute a {@code diff} command
* Return a command object to execute a {@code diff} command
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-diff.html"
* >Git documentation about diff</a>
* @return a {@link DiffCommand} used to collect all optional parameters and
* to finally execute the {@code diff} command
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-diff.html" >Git
* documentation about diff</a>
* @return a {@link org.eclipse.jgit.api.DiffCommand} used to collect all
* optional parameters and to finally execute the {@code diff}
* command
*/
public DiffCommand diff() {
return new DiffCommand(repo);
}
/**
* Returns a command object used to delete tags
* Return a command object used to delete tags
*
* @return a {@link DeleteTagCommand}
* @return a {@link org.eclipse.jgit.api.DeleteTagCommand}
*/
public DeleteTagCommand tagDelete() {
return new DeleteTagCommand(repo);
}
/**
* Returns a command object to execute a {@code submodule add} command
* Return a command object to execute a {@code submodule add} command
*
* @return a {@link SubmoduleAddCommand} used to add a new submodule to a
* parent repository
* @return a {@link org.eclipse.jgit.api.SubmoduleAddCommand} used to add a
* new submodule to a parent repository
*/
public SubmoduleAddCommand submoduleAdd() {
return new SubmoduleAddCommand(repo);
}
/**
* Returns a command object to execute a {@code submodule init} command
* Return a command object to execute a {@code submodule init} command
*
* @return a {@link SubmoduleInitCommand} used to initialize the
* repository's config with settings from the .gitmodules file in
* the working tree
* @return a {@link org.eclipse.jgit.api.SubmoduleInitCommand} used to
* initialize the repository's config with settings from the
* .gitmodules file in the working tree
*/
public SubmoduleInitCommand submoduleInit() {
return new SubmoduleInitCommand(repo);
}
/**
* Returns a command object to execute a {@code submodule status} command
* Return a command object to execute a {@code submodule status} command
*
* @return a {@link SubmoduleStatusCommand} used to report the status of a
* repository's configured submodules
* @return a {@link org.eclipse.jgit.api.SubmoduleStatusCommand} used to
* report the status of a repository's configured submodules
*/
public SubmoduleStatusCommand submoduleStatus() {
return new SubmoduleStatusCommand(repo);
}
/**
* Returns a command object to execute a {@code submodule sync} command
* Return a command object to execute a {@code submodule sync} command
*
* @return a {@link SubmoduleSyncCommand} used to update the URL of a
* submodule from the parent repository's .gitmodules file
* @return a {@link org.eclipse.jgit.api.SubmoduleSyncCommand} used to
* update the URL of a submodule from the parent repository's
* .gitmodules file
*/
public SubmoduleSyncCommand submoduleSync() {
return new SubmoduleSyncCommand(repo);
}
/**
* Returns a command object to execute a {@code submodule update} command
* Return a command object to execute a {@code submodule update} command
*
* @return a {@link SubmoduleUpdateCommand} used to update the submodules in
* a repository to the configured revision
* @return a {@link org.eclipse.jgit.api.SubmoduleUpdateCommand} used to
* update the submodules in a repository to the configured revision
*/
public SubmoduleUpdateCommand submoduleUpdate() {
return new SubmoduleUpdateCommand(repo);
}
/**
* Returns a command object used to list stashed commits
* Return a command object used to list stashed commits
*
* @return a {@link StashListCommand}
* @return a {@link org.eclipse.jgit.api.StashListCommand}
*/
public StashListCommand stashList() {
return new StashListCommand(repo);
}
/**
* Returns a command object used to create a stashed commit
* Return a command object used to create a stashed commit
*
* @return a {@link StashCreateCommand}
* @return a {@link org.eclipse.jgit.api.StashCreateCommand}
* @since 2.0
*/
public StashCreateCommand stashCreate() {
@ -643,9 +673,9 @@ public StashCreateCommand stashCreate() {
}
/**
* Returns a command object used to apply a stashed commit
* Returs a command object used to apply a stashed commit
*
* @return a {@link StashApplyCommand}
* @return a {@link org.eclipse.jgit.api.StashApplyCommand}
* @since 2.0
*/
public StashApplyCommand stashApply() {
@ -653,9 +683,9 @@ public StashApplyCommand stashApply() {
}
/**
* Returns a command object used to drop a stashed commit
* Return a command object used to drop a stashed commit
*
* @return a {@link StashDropCommand}
* @return a {@link org.eclipse.jgit.api.StashDropCommand}
* @since 2.0
*/
public StashDropCommand stashDrop() {
@ -663,14 +693,14 @@ public StashDropCommand stashDrop() {
}
/**
* Returns a command object to execute a {@code apply} command
* Return a command object to execute a {@code apply} command
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-apply.html"
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-apply.html"
* >Git documentation about apply</a>
*
* @return a {@link ApplyCommand} used to collect all optional parameters
* and to finally execute the {@code apply} command
* @return a {@link org.eclipse.jgit.api.ApplyCommand} used to collect all
* optional parameters and to finally execute the {@code apply}
* command
* @since 2.0
*/
public ApplyCommand apply() {
@ -678,14 +708,14 @@ public ApplyCommand apply() {
}
/**
* Returns a command object to execute a {@code gc} command
* Return a command object to execute a {@code gc} command
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-gc.html"
* >Git documentation about gc</a>
*
* @return a {@link GarbageCollectCommand} used to collect all optional
* parameters and to finally execute the {@code gc} command
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-gc.html" >Git
* documentation about gc</a>
* @return a {@link org.eclipse.jgit.api.GarbageCollectCommand} used to
* collect all optional parameters and to finally execute the
* {@code gc} command
* @since 2.2
*/
public GarbageCollectCommand gc() {
@ -693,9 +723,9 @@ public GarbageCollectCommand gc() {
}
/**
* Returns a command object to find human-readable names of revisions.
* Return a command object to find human-readable names of revisions.
*
* @return a {@link NameRevCommand}.
* @return a {@link org.eclipse.jgit.api.NameRevCommand}.
* @since 3.0
*/
public NameRevCommand nameRev() {
@ -703,10 +733,10 @@ public NameRevCommand nameRev() {
}
/**
* Returns a command object to come up with a short name that describes a
* Return a command object to come up with a short name that describes a
* commit in terms of the nearest git tag.
*
* @return a {@link DescribeCommand}.
* @return a {@link org.eclipse.jgit.api.DescribeCommand}.
* @since 3.2
*/
public DescribeCommand describe() {
@ -716,7 +746,7 @@ public DescribeCommand describe() {
/**
* Return a command used to list the available remotes.
*
* @return a {@link RemoteListCommand}
* @return a {@link org.eclipse.jgit.api.RemoteListCommand}
* @since 4.2
*/
public RemoteListCommand remoteList() {
@ -726,7 +756,7 @@ public RemoteListCommand remoteList() {
/**
* Return a command used to add a new remote.
*
* @return a {@link RemoteAddCommand}
* @return a {@link org.eclipse.jgit.api.RemoteAddCommand}
* @since 4.2
*/
public RemoteAddCommand remoteAdd() {
@ -736,7 +766,7 @@ public RemoteAddCommand remoteAdd() {
/**
* Return a command used to remove an existing remote.
*
* @return a {@link RemoteRemoveCommand}
* @return a {@link org.eclipse.jgit.api.RemoteRemoveCommand}
* @since 4.2
*/
public RemoteRemoveCommand remoteRemove() {
@ -746,7 +776,7 @@ public RemoteRemoveCommand remoteRemove() {
/**
* Return a command used to change the URL of an existing remote.
*
* @return a {@link RemoteSetUrlCommand}
* @return a {@link org.eclipse.jgit.api.RemoteSetUrlCommand}
* @since 4.2
*/
public RemoteSetUrlCommand remoteSetUrl() {
@ -754,6 +784,8 @@ public RemoteSetUrlCommand remoteSetUrl() {
}
/**
* Get repository
*
* @return the git repository this class is interacting with; see
* {@link #close()} for notes on closing this repository.
*/
@ -761,6 +793,7 @@ public Repository getRepository() {
return repo;
}
/** {@inheritDoc} */
@Override
public String toString() {
return "Git[" + repo + "]"; //$NON-NLS-1$//$NON-NLS-2$

View File

@ -48,18 +48,20 @@
/**
* Common superclass of all commands in the package {@code org.eclipse.jgit.api}
* <p>
* This class ensures that all commands fulfill the {@link Callable} interface.
* It also has a property {@link #repo} holding a reference to the git
* {@link Repository} this command should work with.
* This class ensures that all commands fulfill the
* {@link java.util.concurrent.Callable} interface. It also has a property
* {@link #repo} holding a reference to the git
* {@link org.eclipse.jgit.lib.Repository} this command should work with.
* <p>
* Finally this class stores a state telling whether it is allowed to call
* {@link #call()} on this instance. Instances of {@link GitCommand} can only be
* used for one single successful call to {@link #call()}. Afterwards this
* instance may not be used anymore to set/modify any properties or to call
* {@link #call()} again. This is achieved by setting the {@link #callable}
* property to false after the successful execution of {@link #call()} and to
* check the state (by calling {@link #checkCallable()}) before setting of
* properties and inside {@link #call()}.
* {@link #call()} on this instance. Instances of
* {@link org.eclipse.jgit.api.GitCommand} can only be used for one single
* successful call to {@link #call()}. Afterwards this instance may not be used
* anymore to set/modify any properties or to call {@link #call()} again. This
* is achieved by setting the {@link #callable} property to false after the
* successful execution of {@link #call()} and to check the state (by calling
* {@link #checkCallable()}) before setting of properties and inside
* {@link #call()}.
*
* @param <T>
* the return type which is expected from {@link #call()}
@ -78,14 +80,18 @@ public abstract class GitCommand<T> implements Callable<T> {
* Creates a new command which interacts with a single repository
*
* @param repo
* the {@link Repository} this command should interact with
* the {@link org.eclipse.jgit.lib.Repository} this command
* should interact with
*/
protected GitCommand(Repository repo) {
this.repo = repo;
}
/**
* @return the {@link Repository} this command is interacting with
* Get repository this command is working on
*
* @return the {@link org.eclipse.jgit.lib.Repository} this command is
* interacting with
*/
public Repository getRepository() {
return repo;
@ -106,9 +112,9 @@ protected void setCallable(boolean callable) {
/**
* Checks that the property {@link #callable} is {@code true}. If not then
* an {@link IllegalStateException} is thrown
* an {@link java.lang.IllegalStateException} is thrown
*
* @throws IllegalStateException
* @throws java.lang.IllegalStateException
* when this method is called and the property {@link #callable}
* is {@code false}
*/
@ -120,11 +126,9 @@ protected void checkCallable() {
}
/**
* Executes the command
*
* @return T a result. Each command has its own return type
* @throws GitAPIException
* or subclass thereof when an error occurs
* {@inheritDoc}
* <p>
* Execute the command
*/
@Override
public abstract T call() throws GitAPIException;

View File

@ -69,9 +69,9 @@ public class InitCommand implements Callable<Git> {
private boolean bare;
/**
* {@inheritDoc}
* <p>
* Executes the {@code Init} command.
*
* @return the newly created {@code Git} object with associated repository
*/
@Override
public Git call() throws GitAPIException {
@ -127,7 +127,7 @@ public Git call() throws GitAPIException {
* @param directory
* the directory to init to
* @return this instance
* @throws IllegalStateException
* @throws java.lang.IllegalStateException
* if the combination of directory, gitDir and bare is illegal.
* E.g. if for a non-bare repository directory and gitDir point
* to the same directory of if for a bare repository both
@ -141,10 +141,12 @@ public InitCommand setDirectory(File directory)
}
/**
* Set the repository meta directory (.git)
*
* @param gitDir
* the repository meta directory
* @return this instance
* @throws IllegalStateException
* @throws java.lang.IllegalStateException
* if the combination of directory, gitDir and bare is illegal.
* E.g. if for a non-bare repository directory and gitDir point
* to the same directory of if for a bare repository both
@ -176,9 +178,11 @@ private static void validateDirs(File directory, File gitDir, boolean bare)
}
/**
* Set whether the repository is bare or not
*
* @param bare
* whether the repository is bare or not
* @throws IllegalStateException
* @throws java.lang.IllegalStateException
* if the combination of directory, gitDir and bare is illegal.
* E.g. if for a non-bare repository directory and gitDir point
* to the same directory of if for a bare repository both

View File

@ -95,12 +95,16 @@ public enum ListMode {
}
/**
* Constructor for ListBranchCommand.
*
* @param repo
* a {@link org.eclipse.jgit.lib.Repository} object.
*/
protected ListBranchCommand(Repository repo) {
super(repo);
}
/** {@inheritDoc} */
@Override
public List<Ref> call() throws GitAPIException {
checkCallable();
@ -154,6 +158,8 @@ private Collection<Ref> filterRefs(Collection<Ref> refs)
}
/**
* Set the list mode
*
* @param listMode
* optional: corresponds to the -r/-a options; by default, only
* local branches will be listed

View File

@ -68,15 +68,16 @@ public class ListNotesCommand extends GitCommand<List<Note>> {
private String notesRef = Constants.R_NOTES_COMMITS;
/**
* Constructor for ListNotesCommand.
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
protected ListNotesCommand(Repository repo) {
super(repo);
}
/**
* @return the requested notes
*/
/** {@inheritDoc} */
@Override
public List<Note> call() throws GitAPIException {
checkCallable();
@ -101,12 +102,14 @@ public List<Note> call() throws GitAPIException {
}
/**
* @param notesRef
* the ref to read notes from. Note, the default value of
* {@link Constants#R_NOTES_COMMITS} will be used if nothing is
* set
* @return {@code this}
* Set the {@code Ref} to read notes from
*
* @param notesRef
* the name of the {@code Ref} to read notes from. Note, the
* default value of
* {@link org.eclipse.jgit.lib.Constants#R_NOTES_COMMITS} will be
* used if nothing is set
* @return {@code this}
* @see Constants#R_NOTES_COMMITS
*/
public ListNotesCommand setNotesRef(String notesRef) {

View File

@ -65,15 +65,16 @@
public class ListTagCommand extends GitCommand<List<Ref>> {
/**
* Constructor for ListTagCommand.
*
* @param repo
* a {@link org.eclipse.jgit.lib.Repository} object.
*/
protected ListTagCommand(Repository repo) {
super(repo);
}
/**
* @return the tags available
*/
/** {@inheritDoc} */
@Override
public List<Ref> call() throws GitAPIException {
checkCallable();

View File

@ -78,7 +78,7 @@
* to finally execute the command. Each instance of this class should only be
* used for one invocation of the command (means: one call to {@link #call()})
* <p>
* Examples (<code>git</code> is a {@link Git} instance):
* Examples (<code>git</code> is a {@link org.eclipse.jgit.api.Git} instance):
* <p>
* Get newest 10 commits, starting from the current branch:
*
@ -114,7 +114,10 @@ public class LogCommand extends GitCommand<Iterable<RevCommit>> {
private int skip = -1;
/**
* Constructor for LogCommand.
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
protected LogCommand(Repository repo) {
super(repo);
@ -122,15 +125,13 @@ protected LogCommand(Repository repo) {
}
/**
* {@inheritDoc}
* <p>
* Executes the {@code Log} command with all the options and parameters
* collected by the setter methods (e.g. {@link #add(AnyObjectId)},
* {@link #not(AnyObjectId)}, ..) of this class. Each instance of this class
* should only be used for one invocation of the command. Don't call this
* method twice on an instance.
*
* @return an iteration over RevCommits
* @throws NoHeadException
* of the references ref cannot be resolved
*/
@Override
public Iterable<RevCommit> call() throws GitAPIException, NoHeadException {
@ -174,23 +175,26 @@ else if (maxCount > -1)
*
* @see RevWalk#markStart(RevCommit)
* @param start
* the id of the commit to start from
* @return {@code this}
* @throws MissingObjectException
* @throws org.eclipse.jgit.errors.MissingObjectException
* the commit supplied is not available from the object
* database. This usually indicates the supplied commit is
* invalid, but the reference was constructed during an earlier
* invocation to {@link RevWalk#lookupCommit(AnyObjectId)}.
* @throws IncorrectObjectTypeException
* invocation to
* {@link org.eclipse.jgit.revwalk.RevWalk#lookupCommit(AnyObjectId)}.
* @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
* the object was not parsed yet and it was discovered during
* parsing that it is not actually a commit. This usually
* indicates the caller supplied a non-commit SHA-1 to
* {@link RevWalk#lookupCommit(AnyObjectId)}.
* {@link org.eclipse.jgit.revwalk.RevWalk#lookupCommit(AnyObjectId)}.
* @throws JGitInternalException
* a low-level exception of JGit has occurred. The original
* exception can be retrieved by calling
* {@link Exception#getCause()}. Expect only
* {@link java.lang.Exception#getCause()}. Expect only
* {@code IOException's} to be wrapped. Subclasses of
* {@link IOException} (e.g. {@link MissingObjectException}) are
* {@link java.io.IOException} (e.g.
* {@link org.eclipse.jgit.errors.MissingObjectException}) are
* typically not wrapped here but thrown as original exception
*/
public LogCommand add(AnyObjectId start) throws MissingObjectException,
@ -202,23 +206,26 @@ public LogCommand add(AnyObjectId start) throws MissingObjectException,
* Same as {@code --not start}, or {@code ^start}
*
* @param start
* a {@link org.eclipse.jgit.lib.AnyObjectId}
* @return {@code this}
* @throws MissingObjectException
* @throws org.eclipse.jgit.errors.MissingObjectException
* the commit supplied is not available from the object
* database. This usually indicates the supplied commit is
* invalid, but the reference was constructed during an earlier
* invocation to {@link RevWalk#lookupCommit(AnyObjectId)}.
* @throws IncorrectObjectTypeException
* invocation to
* {@link org.eclipse.jgit.revwalk.RevWalk#lookupCommit(AnyObjectId)}.
* @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
* the object was not parsed yet and it was discovered during
* parsing that it is not actually a commit. This usually
* indicates the caller supplied a non-commit SHA-1 to
* {@link RevWalk#lookupCommit(AnyObjectId)}.
* {@link org.eclipse.jgit.revwalk.RevWalk#lookupCommit(AnyObjectId)}.
* @throws JGitInternalException
* a low-level exception of JGit has occurred. The original
* exception can be retrieved by calling
* {@link Exception#getCause()}. Expect only
* {@link java.lang.Exception#getCause()}. Expect only
* {@code IOException's} to be wrapped. Subclasses of
* {@link IOException} (e.g. {@link MissingObjectException}) are
* {@link java.io.IOException} (e.g.
* {@link org.eclipse.jgit.errors.MissingObjectException}) are
* typically not wrapped here but thrown as original exception
*/
public LogCommand not(AnyObjectId start) throws MissingObjectException,
@ -230,24 +237,28 @@ public LogCommand not(AnyObjectId start) throws MissingObjectException,
* Adds the range {@code since..until}
*
* @param since
* a {@link org.eclipse.jgit.lib.AnyObjectId} object.
* @param until
* a {@link org.eclipse.jgit.lib.AnyObjectId} object.
* @return {@code this}
* @throws MissingObjectException
* @throws org.eclipse.jgit.errors.MissingObjectException
* the commit supplied is not available from the object
* database. This usually indicates the supplied commit is
* invalid, but the reference was constructed during an earlier
* invocation to {@link RevWalk#lookupCommit(AnyObjectId)}.
* @throws IncorrectObjectTypeException
* invocation to
* {@link org.eclipse.jgit.revwalk.RevWalk#lookupCommit(AnyObjectId)}.
* @throws org.eclipse.jgit.errors.IncorrectObjectTypeException
* the object was not parsed yet and it was discovered during
* parsing that it is not actually a commit. This usually
* indicates the caller supplied a non-commit SHA-1 to
* {@link RevWalk#lookupCommit(AnyObjectId)}.
* {@link org.eclipse.jgit.revwalk.RevWalk#lookupCommit(AnyObjectId)}.
* @throws JGitInternalException
* a low-level exception of JGit has occurred. The original
* exception can be retrieved by calling
* {@link Exception#getCause()}. Expect only
* {@link java.lang.Exception#getCause()}. Expect only
* {@code IOException's} to be wrapped. Subclasses of
* {@link IOException} (e.g. {@link MissingObjectException}) are
* {@link java.io.IOException} (e.g.
* {@link org.eclipse.jgit.errors.MissingObjectException}) are
* typically not wrapped here but thrown as original exception
*/
public LogCommand addRange(AnyObjectId since, AnyObjectId until)
@ -260,7 +271,7 @@ public LogCommand addRange(AnyObjectId since, AnyObjectId until)
*
* @see #add(AnyObjectId)
* @return {@code this}
* @throws IOException
* @throws java.io.IOException
* the references could not be accessed
*/
public LogCommand all() throws IOException {
@ -354,8 +365,7 @@ private LogCommand add(boolean include, AnyObjectId start)
/**
* Sets a filter for the <code>LogCommand</code>.
*
* Set a filter for the <code>LogCommand</code>.
*
* @param aFilter
* the filter that this instance of <code>LogCommand</code>

View File

@ -83,6 +83,8 @@ public class LsRemoteCommand extends
private String uploadPack;
/**
* Constructor for LsRemoteCommand
*
* @param repo
* local repository or null for operation without local
* repository
@ -98,6 +100,7 @@ public LsRemoteCommand(Repository repo) {
*
* @see Constants#DEFAULT_REMOTE_NAME
* @param remote
* a {@link java.lang.String} object.
* @return {@code this}
*/
public LsRemoteCommand setRemote(String remote) {
@ -110,6 +113,7 @@ public LsRemoteCommand setRemote(String remote) {
* Include refs/heads in references results
*
* @param heads
* whether to include refs/heads
* @return {@code this}
*/
public LsRemoteCommand setHeads(boolean heads) {
@ -121,6 +125,7 @@ public LsRemoteCommand setHeads(boolean heads) {
* Include refs/tags in references results
*
* @param tags
* whether to include tags
* @return {@code this}
*/
public LsRemoteCommand setTags(boolean tags) {
@ -132,6 +137,8 @@ public LsRemoteCommand setTags(boolean tags) {
* The full path of git-upload-pack on the remote host
*
* @param uploadPack
* the full path of executable providing the git-upload-pack
* service on remote host
* @return {@code this}
*/
public LsRemoteCommand setUploadPack(String uploadPack) {
@ -140,18 +147,12 @@ public LsRemoteCommand setUploadPack(String uploadPack) {
}
/**
* Executes the {@code LsRemote} command with all the options and parameters
* {@inheritDoc}
* <p>
* Execute the {@code LsRemote} command with all the options and parameters
* collected by the setter methods (e.g. {@link #setHeads(boolean)}) of this
* class. Each instance of this class should only be used for one invocation
* of the command. Don't call this method twice on an instance.
*
* @return a collection of references in the remote repository
* @throws GitAPIException
* or subclass thereof when an error occurs
* @throws InvalidRemoteException
* when called with an invalid remote uri
* @throws org.eclipse.jgit.api.errors.TransportException
* for errors that occurs during transport
*/
@Override
public Collection<Ref> call() throws GitAPIException,
@ -164,9 +165,9 @@ public Collection<Ref> call() throws GitAPIException,
* Same as {@link #call()}, but return Map instead of Collection.
*
* @return a map from names to references in the remote repository
* @throws GitAPIException
* @throws org.eclipse.jgit.api.errors.GitAPIException
* or subclass thereof when an error occurs
* @throws InvalidRemoteException
* @throws org.eclipse.jgit.api.errors.InvalidRemoteException
* when called with an invalid remote uri
* @throws org.eclipse.jgit.api.errors.TransportException
* for errors that occurs during transport

View File

@ -211,19 +211,22 @@ public static FastForwardMode valueOf(FastForwardMode.Merge ffMode) {
private Boolean commit;
/**
* Constructor for MergeCommand.
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
protected MergeCommand(Repository repo) {
super(repo);
}
/**
* Executes the {@code Merge} command with all the options and parameters
* {@inheritDoc}
* <p>
* Execute the {@code Merge} command with all the options and parameters
* collected by the setter methods (e.g. {@link #include(Ref)}) of this
* class. Each instance of this class should only be used for one invocation
* of the command. Don't call this method twice on an instance.
*
* @return the result of the merge
*/
@Override
@SuppressWarnings("boxing")
@ -492,9 +495,10 @@ private void updateHead(StringBuilder refLogMessage, ObjectId newHeadId,
}
/**
* Set merge strategy
*
* @param mergeStrategy
* the {@link MergeStrategy} to be used
* the {@link org.eclipse.jgit.merge.MergeStrategy} to be used
* @return {@code this}
*/
public MergeCommand setStrategy(MergeStrategy mergeStrategy) {
@ -504,6 +508,8 @@ public MergeCommand setStrategy(MergeStrategy mergeStrategy) {
}
/**
* Reference to a commit to be merged with the current head
*
* @param aCommit
* a reference to a commit which is merged with the current head
* @return {@code this}
@ -515,6 +521,8 @@ public MergeCommand include(Ref aCommit) {
}
/**
* Id of a commit which is to be merged with the current head
*
* @param aCommit
* the Id of a commit which is merged with the current head
* @return {@code this}
@ -524,8 +532,10 @@ public MergeCommand include(AnyObjectId aCommit) {
}
/**
* Include a commit
*
* @param name
* a name given to the commit
* a name of a {@code Ref} pointing to the commit
* @param aCommit
* the Id of a commit which is merged with the current head
* @return {@code this}
@ -541,9 +551,10 @@ public MergeCommand include(String name, AnyObjectId aCommit) {
* HEAD. Otherwise, perform the merge and commit the result.
* <p>
* In case the merge was successful but this flag was set to
* <code>true</code> a {@link MergeResult} with status
* {@link MergeStatus#MERGED_SQUASHED} or
* {@link MergeStatus#FAST_FORWARD_SQUASHED} is returned.
* <code>true</code> a {@link org.eclipse.jgit.api.MergeResult} with status
* {@link org.eclipse.jgit.api.MergeResult.MergeStatus#MERGED_SQUASHED} or
* {@link org.eclipse.jgit.api.MergeResult.MergeStatus#FAST_FORWARD_SQUASHED}
* is returned.
*
* @param squash
* whether to squash commits or not
@ -582,9 +593,11 @@ public MergeCommand setFastForward(
* <code>true</code> if this command should commit (this is the
* default behavior). <code>false</code> if this command should
* not commit. In case the merge was successful but this flag was
* set to <code>false</code> a {@link MergeResult} with type
* {@link MergeResult} with status
* {@link MergeStatus#MERGED_NOT_COMMITTED} is returned
* set to <code>false</code> a
* {@link org.eclipse.jgit.api.MergeResult} with type
* {@link org.eclipse.jgit.api.MergeResult} with status
* {@link org.eclipse.jgit.api.MergeResult.MergeStatus#MERGED_NOT_COMMITTED}
* is returned
* @return {@code this}
* @since 3.0
*/
@ -612,7 +625,6 @@ public MergeCommand setMessage(String message) {
* is set to <code>NullProgressMonitor</code>
*
* @see NullProgressMonitor
*
* @param monitor
* A progress monitor
* @return this instance

View File

@ -53,11 +53,10 @@
import org.eclipse.jgit.merge.MergeChunk;
import org.eclipse.jgit.merge.MergeChunk.ConflictState;
import org.eclipse.jgit.merge.MergeStrategy;
import org.eclipse.jgit.merge.ResolveMerger;
import org.eclipse.jgit.merge.ResolveMerger.MergeFailureReason;
/**
* Encapsulates the result of a {@link MergeCommand}.
* Encapsulates the result of a {@link org.eclipse.jgit.api.MergeCommand}.
*/
public class MergeResult {
@ -249,6 +248,8 @@ public boolean isSuccessful() {
private List<String> checkoutConflicts;
/**
* Constructor for MergeResult.
*
* @param newHead
* the object the head points at after the merge
* @param base
@ -260,10 +261,10 @@ public boolean isSuccessful() {
* @param mergeStatus
* the status the merge resulted in
* @param mergeStrategy
* the used {@link MergeStrategy}
* the used {@link org.eclipse.jgit.merge.MergeStrategy}
* @param lowLevelResults
* merge results as returned by
* {@link ResolveMerger#getMergeResults()}
* {@link org.eclipse.jgit.merge.ResolveMerger#getMergeResults()}
* @since 2.0
*/
public MergeResult(ObjectId newHead, ObjectId base,
@ -275,6 +276,8 @@ public MergeResult(ObjectId newHead, ObjectId base,
}
/**
* Constructor for MergeResult.
*
* @param newHead
* the object the head points at after the merge
* @param base
@ -286,9 +289,10 @@ public MergeResult(ObjectId newHead, ObjectId base,
* @param mergeStatus
* the status the merge resulted in
* @param mergeStrategy
* the used {@link MergeStrategy}
* the used {@link org.eclipse.jgit.merge.MergeStrategy}
* @param lowLevelResults
* merge results as returned by {@link ResolveMerger#getMergeResults()}
* merge results as returned by
* {@link org.eclipse.jgit.merge.ResolveMerger#getMergeResults()}
* @param description
* a user friendly description of the merge result
*/
@ -302,6 +306,8 @@ public MergeResult(ObjectId newHead, ObjectId base,
}
/**
* Constructor for MergeResult.
*
* @param newHead
* the object the head points at after the merge
* @param base
@ -313,13 +319,13 @@ public MergeResult(ObjectId newHead, ObjectId base,
* @param mergeStatus
* the status the merge resulted in
* @param mergeStrategy
* the used {@link MergeStrategy}
* the used {@link org.eclipse.jgit.merge.MergeStrategy}
* @param lowLevelResults
* merge results as returned by
* {@link ResolveMerger#getMergeResults()}
* {@link org.eclipse.jgit.merge.ResolveMerger#getMergeResults()}
* @param failingPaths
* list of paths causing this merge to fail as returned by
* {@link ResolveMerger#getFailingPaths()}
* {@link org.eclipse.jgit.merge.ResolveMerger#getFailingPaths()}
* @param description
* a user friendly description of the merge result
*/
@ -354,6 +360,8 @@ public MergeResult(List<String> checkoutConflicts) {
}
/**
* Get the object the head points at after the merge
*
* @return the object the head points at after the merge
*/
public ObjectId getNewHead() {
@ -361,6 +369,8 @@ public ObjectId getNewHead() {
}
/**
* Get the merge status
*
* @return the status the merge resulted in
*/
public MergeStatus getMergeStatus() {
@ -368,6 +378,8 @@ public MergeStatus getMergeStatus() {
}
/**
* Get the commits which have been merged
*
* @return all the commits which have been merged together
*/
public ObjectId[] getMergedCommits() {
@ -375,6 +387,8 @@ public ObjectId[] getMergedCommits() {
}
/**
* Get the common base
*
* @return base the common base which was used to produce a content-merge.
* May be <code>null</code> if the merge-result was produced without
* computing a common base
@ -383,6 +397,7 @@ public ObjectId getBase() {
return base;
}
/** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
@ -402,6 +417,8 @@ public String toString() {
}
/**
* Set conflicts
*
* @param conflicts
* the conflicts to set
*/
@ -410,7 +427,10 @@ public void setConflicts(Map<String, int[][]> conflicts) {
}
/**
* Add a conflict
*
* @param path
* path of the file to add a conflict for
* @param conflictingRanges
* the conflicts to set
*/
@ -421,8 +441,12 @@ public void addConflict(String path, int[][] conflictingRanges) {
}
/**
* Add a conflict
*
* @param path
* path of the file to add a conflict for
* @param lowLevelResult
* a {@link org.eclipse.jgit.merge.MergeResult}
*/
public void addConflict(String path, org.eclipse.jgit.merge.MergeResult<?> lowLevelResult) {
if (!lowLevelResult.containsConflicts())
@ -462,9 +486,10 @@ public void addConflict(String path, org.eclipse.jgit.merge.MergeResult<?> lowLe
/**
* Returns information about the conflicts which occurred during a
* {@link MergeCommand}. The returned value maps the path of a conflicting
* file to a two-dimensional int-array of line-numbers telling where in the
* file conflict markers for which merged commit can be found.
* {@link org.eclipse.jgit.api.MergeCommand}. The returned value maps the
* path of a conflicting file to a two-dimensional int-array of line-numbers
* telling where in the file conflict markers for which merged commit can be
* found.
* <p>
* If the returned value contains a mapping "path"-&gt;[x][y]=z then this
* means
@ -505,7 +530,7 @@ public Map<String, int[][]> getConflicts() {
/**
* Returns a list of paths causing this merge to fail as returned by
* {@link ResolveMerger#getFailingPaths()}
* {@link org.eclipse.jgit.merge.ResolveMerger#getFailingPaths()}
*
* @return the list of paths causing this merge to fail or <code>null</code>
* if no failure occurred

View File

@ -57,7 +57,6 @@
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.RefDatabase;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.FIFORevQueue;
import org.eclipse.jgit.revwalk.RevCommit;
@ -120,6 +119,7 @@ public String toString() {
* Create a new name-rev command.
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
protected NameRevCommand(Repository repo) {
super(repo);
@ -134,6 +134,7 @@ public NameRevCommit createCommit(AnyObjectId id) {
};
}
/** {@inheritDoc} */
@Override
public Map<ObjectId, String> call() throws GitAPIException {
try {
@ -199,13 +200,13 @@ public Map<ObjectId, String> call() throws GitAPIException {
* @param id
* object ID to add.
* @return {@code this}
* @throws MissingObjectException
* @throws org.eclipse.jgit.errors.MissingObjectException
* the object supplied is not available from the object
* database.
* @throws JGitInternalException
* @throws org.eclipse.jgit.api.errors.JGitInternalException
* a low-level exception of JGit has occurred. The original
* exception can be retrieved by calling
* {@link Exception#getCause()}.
* {@link java.lang.Exception#getCause()}.
*/
public NameRevCommand add(ObjectId id) throws MissingObjectException,
JGitInternalException {
@ -227,13 +228,13 @@ public NameRevCommand add(ObjectId id) throws MissingObjectException,
* @param ids
* object IDs to add.
* @return {@code this}
* @throws MissingObjectException
* @throws org.eclipse.jgit.errors.MissingObjectException
* the object supplied is not available from the object
* database.
* @throws JGitInternalException
* @throws org.eclipse.jgit.api.errors.JGitInternalException
* a low-level exception of JGit has occurred. The original
* exception can be retrieved by calling
* {@link Exception#getCause()}.
* {@link java.lang.Exception#getCause()}.
*/
public NameRevCommand add(Iterable<ObjectId> ids)
throws MissingObjectException, JGitInternalException {
@ -250,7 +251,8 @@ public NameRevCommand add(Iterable<ObjectId> ids)
* prefix added by {@link #addPrefix(String)}.
*
* @param prefix
* prefix to add; see {@link RefDatabase#getRefs(String)}
* prefix to add; see
* {@link org.eclipse.jgit.lib.RefDatabase#getRefs(String)}
* @return {@code this}
*/
public NameRevCommand addPrefix(String prefix) {
@ -260,8 +262,8 @@ public NameRevCommand addPrefix(String prefix) {
}
/**
* Add all annotated tags under {@code refs/tags/} to the set that all results
* must match.
* Add all annotated tags under {@code refs/tags/} to the set that all
* results must match.
* <p>
* Calls {@link #addRef(Ref)}; see that method for a note on matching
* priority.
@ -270,7 +272,7 @@ public NameRevCommand addPrefix(String prefix) {
* @throws JGitInternalException
* a low-level exception of JGit has occurred. The original
* exception can be retrieved by calling
* {@link Exception#getCause()}.
* {@link java.lang.Exception#getCause()}.
*/
public NameRevCommand addAnnotatedTags() {
checkCallable();

View File

@ -52,7 +52,6 @@
import org.eclipse.jgit.api.MergeCommand.FastForwardMode.Merge;
import org.eclipse.jgit.api.RebaseCommand.Operation;
import org.eclipse.jgit.api.errors.CanceledException;
import org.eclipse.jgit.api.errors.DetachedHeadException;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.api.errors.InvalidConfigurationException;
import org.eclipse.jgit.api.errors.InvalidRemoteException;
@ -104,13 +103,18 @@ public class PullCommand extends TransportCommand<PullCommand, PullResult> {
private FetchRecurseSubmodulesMode submoduleRecurseMode = null;
/**
* Constructor for PullCommand.
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
protected PullCommand(Repository repo) {
super(repo);
}
/**
* Set progress monitor
*
* @param monitor
* a progress monitor
* @return this instance
@ -139,6 +143,7 @@ public PullCommand setProgressMonitor(ProgressMonitor monitor) {
* branch.[name].rebase and branch.autosetuprebase.
*
* @param useRebase
* whether to use rebase after fetching
* @return {@code this}
*/
public PullCommand setRebase(boolean useRebase) {
@ -149,7 +154,8 @@ public PullCommand setRebase(boolean useRebase) {
}
/**
* Sets the {@link BranchRebaseMode} to use after fetching.
* Sets the {@link org.eclipse.jgit.lib.BranchConfig.BranchRebaseMode} to
* use after fetching.
*
* <dl>
* <dt>BranchRebaseMode.REBASE</dt>
@ -176,7 +182,8 @@ public PullCommand setRebase(boolean useRebase) {
* {@code pull.rebase}.
*
* @param rebaseMode
* the {@link BranchRebaseMode} to use
* the {@link org.eclipse.jgit.lib.BranchConfig.BranchRebaseMode}
* to use
* @return {@code this}
* @since 4.5
*/
@ -187,23 +194,13 @@ public PullCommand setRebase(BranchRebaseMode rebaseMode) {
}
/**
* Executes the {@code Pull} command with all the options and parameters
* {@inheritDoc}
* <p>
* Execute the {@code Pull} command with all the options and parameters
* collected by the setter methods (e.g.
* {@link #setProgressMonitor(ProgressMonitor)}) of this class. Each
* instance of this class should only be used for one invocation of the
* command. Don't call this method twice on an instance.
*
* @return the result of the pull
* @throws WrongRepositoryStateException
* @throws InvalidConfigurationException
* @throws DetachedHeadException
* @throws InvalidRemoteException
* @throws CanceledException
* @throws RefNotFoundException
* @throws RefNotAdvertisedException
* @throws NoHeadException
* @throws org.eclipse.jgit.api.errors.TransportException
* @throws GitAPIException
*/
@Override
public PullResult call() throws GitAPIException,
@ -370,6 +367,7 @@ public PullResult call() throws GitAPIException,
*
* @see Constants#DEFAULT_REMOTE_NAME
* @param remote
* name of the remote to pull from
* @return {@code this}
* @since 3.3
*/
@ -386,6 +384,7 @@ public PullCommand setRemote(String remote) {
* the current branch is used.
*
* @param remoteBranchName
* remote branch name to be used for pull operation
* @return {@code this}
* @since 3.3
*/
@ -396,6 +395,8 @@ public PullCommand setRemoteBranchName(String remoteBranchName) {
}
/**
* Get the remote name used for pull operation
*
* @return the remote used for the pull operation if it was set explicitly
* @since 3.3
*/
@ -404,6 +405,8 @@ public String getRemote() {
}
/**
* Get the remote branch name for the pull operation
*
* @return the remote branch name used for the pull operation if it was set
* explicitly
* @since 3.3
@ -413,6 +416,8 @@ public String getRemoteBranchName() {
}
/**
* Set the @{code MergeStrategy}
*
* @param strategy
* The merge strategy to use during this pull operation.
* @return {@code this}
@ -424,9 +429,10 @@ public PullCommand setStrategy(MergeStrategy strategy) {
}
/**
* Sets the specification of annotated tag behavior during fetch
* Set the specification of annotated tag behavior during fetch
*
* @param tagOpt
* the {@link org.eclipse.jgit.transport.TagOpt}
* @return {@code this}
* @since 4.7
*/
@ -437,8 +443,8 @@ public PullCommand setTagOpt(TagOpt tagOpt) {
}
/**
* Sets the fast forward mode. It is used if pull is configured to do a
* merge as opposed to rebase. If non-{@code null} takes precedence over the
* Set the fast forward mode. It is used if pull is configured to do a merge
* as opposed to rebase. If non-{@code null} takes precedence over the
* fast-forward mode configured in git config.
*
* @param fastForwardMode
@ -461,6 +467,9 @@ public PullCommand setFastForward(
* Set the mode to be used for recursing into submodules.
*
* @param recurse
* the
* {@link org.eclipse.jgit.lib.SubmoduleConfig.FetchRecurseSubmodulesMode}
* to be used for recursing into submodules
* @return {@code this}
* @since 4.7
* @see FetchCommand#setRecurseSubmodules(FetchRecurseSubmodulesMode)
@ -475,13 +484,14 @@ public PullCommand setRecurseSubmodules(
* Reads the rebase mode to use for a pull command from the repository
* configuration. This is the value defined for the configurations
* {@code branch.[branchName].rebase}, or,if not set, {@code pull.rebase}.
* If neither is set, yields {@link BranchRebaseMode#NONE}.
* If neither is set, yields
* {@link org.eclipse.jgit.lib.BranchConfig.BranchRebaseMode#NONE}.
*
* @param branchName
* name of the local branch
* @param config
* the {@link Config} to read the value from
* @return the {@link BranchRebaseMode}
* the {@link org.eclipse.jgit.lib.Config} to read the value from
* @return the {@link org.eclipse.jgit.lib.BranchConfig.BranchRebaseMode}
* @since 4.5
*/
public static BranchRebaseMode getRebaseMode(String branchName,

View File

@ -45,7 +45,7 @@
import org.eclipse.jgit.transport.FetchResult;
/**
* Encapsulates the result of a {@link PullCommand}
* Encapsulates the result of a {@link org.eclipse.jgit.api.PullCommand}
*/
public class PullResult {
private final FetchResult fetchResult;
@ -73,6 +73,8 @@ public class PullResult {
}
/**
* Get fetch result
*
* @return the fetch result, or <code>null</code>
*/
public FetchResult getFetchResult() {
@ -80,6 +82,8 @@ public FetchResult getFetchResult() {
}
/**
* Get merge result
*
* @return the merge result, or <code>null</code>
*/
public MergeResult getMergeResult() {
@ -87,6 +91,8 @@ public MergeResult getMergeResult() {
}
/**
* Get rebase result
*
* @return the rebase result, or <code>null</code>
*/
public RebaseResult getRebaseResult() {
@ -94,6 +100,8 @@ public RebaseResult getRebaseResult() {
}
/**
* Get name of the remote configuration from which fetch was tried
*
* @return the name of the remote configuration from which fetch was tried,
* or <code>null</code>
*/
@ -102,6 +110,8 @@ public String getFetchedFrom() {
}
/**
* Whether the pull was successful
*
* @return whether the pull was successful
*/
public boolean isSuccessful() {
@ -112,6 +122,7 @@ else if (rebaseResult != null)
return true;
}
/** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {

View File

@ -105,7 +105,12 @@ public class PushCommand extends
private List<String> pushOptions;
/**
* <p>
* Constructor for PushCommand.
* </p>
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
protected PushCommand(Repository repo) {
super(repo);
@ -114,17 +119,12 @@ protected PushCommand(Repository repo) {
}
/**
* Executes the {@code push} command with all the options and parameters
* {@inheritDoc}
* <p>
* Execute the {@code push} command with all the options and parameters
* collected by the setter methods of this class. Each instance of this
* class should only be used for one invocation of the command (means: one
* call to {@link #call()})
*
* @return an iteration over {@link PushResult} objects
* @throws InvalidRemoteException
* when called with an invalid remote uri
* @throws org.eclipse.jgit.api.errors.TransportException
* when an error occurs with the transport
* @throws GitAPIException
*/
@Override
public Iterable<PushResult> call() throws GitAPIException,
@ -209,6 +209,7 @@ public Iterable<PushResult> call() throws GitAPIException,
*
* @see Constants#DEFAULT_REMOTE_NAME
* @param remote
* the remote name
* @return {@code this}
*/
public PushCommand setRemote(String remote) {
@ -218,6 +219,8 @@ public PushCommand setRemote(String remote) {
}
/**
* Get remote name
*
* @return the remote used for the remote operation
*/
public String getRemote() {
@ -231,6 +234,8 @@ public String getRemote() {
*
* @see RemoteConfig#DEFAULT_RECEIVE_PACK
* @param receivePack
* name of the remote executable providing the receive-pack
* service
* @return {@code this}
*/
public PushCommand setReceivePack(String receivePack) {
@ -240,6 +245,8 @@ public PushCommand setReceivePack(String receivePack) {
}
/**
* Get the name of the remote executable providing the receive-pack service
*
* @return the receive-pack used for the remote operation
*/
public String getReceivePack() {
@ -247,6 +254,8 @@ public String getReceivePack() {
}
/**
* Get timeout used for push operation
*
* @return the timeout used for the push operation
*/
public int getTimeout() {
@ -254,6 +263,8 @@ public int getTimeout() {
}
/**
* Get the progress monitor
*
* @return the progress monitor for the push operation
*/
public ProgressMonitor getProgressMonitor() {
@ -265,8 +276,8 @@ public ProgressMonitor getProgressMonitor() {
* is set to <code>NullProgressMonitor</code>
*
* @see NullProgressMonitor
*
* @param monitor
* a {@link org.eclipse.jgit.lib.ProgressMonitor}
* @return {@code this}
*/
public PushCommand setProgressMonitor(ProgressMonitor monitor) {
@ -279,7 +290,9 @@ public PushCommand setProgressMonitor(ProgressMonitor monitor) {
}
/**
* @return the ref lease specs
* Get the <code>RefLeaseSpec</code>s.
*
* @return the <code>RefLeaseSpec</code>s
* @since 4.7
*/
public List<RefLeaseSpec> getRefLeaseSpecs() {
@ -287,10 +300,11 @@ public List<RefLeaseSpec> getRefLeaseSpecs() {
}
/**
* The ref lease specs to be used in the push operation,
* for a force-with-lease push operation.
* The ref lease specs to be used in the push operation, for a
* force-with-lease push operation.
*
* @param specs
* a {@link org.eclipse.jgit.transport.RefLeaseSpec} object.
* @return {@code this}
* @since 4.7
*/
@ -299,10 +313,11 @@ public PushCommand setRefLeaseSpecs(RefLeaseSpec... specs) {
}
/**
* The ref lease specs to be used in the push operation,
* for a force-with-lease push operation.
* The ref lease specs to be used in the push operation, for a
* force-with-lease push operation.
*
* @param specs
* list of {@code RefLeaseSpec}s
* @return {@code this}
* @since 4.7
*/
@ -316,6 +331,9 @@ public PushCommand setRefLeaseSpecs(List<RefLeaseSpec> specs) {
}
/**
* Get <code>RefSpec</code>s.
* </p>
*
* @return the ref specs
*/
public List<RefSpec> getRefSpecs() {
@ -325,7 +343,7 @@ public List<RefSpec> getRefSpecs() {
/**
* The ref specs to be used in the push operation
*
* @param specs
* @param specs a {@link org.eclipse.jgit.transport.RefSpec} object.
* @return {@code this}
*/
public PushCommand setRefSpecs(RefSpec... specs) {
@ -339,6 +357,7 @@ public PushCommand setRefSpecs(RefSpec... specs) {
* The ref specs to be used in the push operation
*
* @param specs
* list of {@link org.eclipse.jgit.transport.RefSpec}s
* @return {@code this}
*/
public PushCommand setRefSpecs(List<RefSpec> specs) {
@ -408,6 +427,8 @@ public PushCommand add(String nameOrSpec) {
}
/**
* Whether to run the push operation as a dry run
*
* @return the dry run preference for the push operation
*/
public boolean isDryRun() {
@ -417,7 +438,7 @@ public boolean isDryRun() {
/**
* Sets whether the push operation should be a dry run
*
* @param dryRun
* @param dryRun a boolean.
* @return {@code this}
*/
public PushCommand setDryRun(boolean dryRun) {
@ -427,6 +448,8 @@ public PushCommand setDryRun(boolean dryRun) {
}
/**
* Get the thin-pack preference
*
* @return the thin-pack preference for push operation
*/
public boolean isThin() {
@ -434,11 +457,12 @@ public boolean isThin() {
}
/**
* Sets the thin-pack preference for push operation.
* Set the thin-pack preference for push operation.
*
* Default setting is Transport.DEFAULT_PUSH_THIN
*
* @param thin
* the thin-pack preference value
* @return {@code this}
*/
public PushCommand setThin(boolean thin) {
@ -448,6 +472,9 @@ public PushCommand setThin(boolean thin) {
}
/**
* Whether this push should be executed atomically (all references updated,
* or none)
*
* @return true if all-or-nothing behavior is requested.
* @since 4.2
*/
@ -461,6 +488,7 @@ public boolean isAtomic() {
* Default setting is false.
*
* @param atomic
* whether to run the push atomically
* @return {@code this}
* @since 4.2
*/
@ -471,6 +499,8 @@ public PushCommand setAtomic(boolean atomic) {
}
/**
* Whether to push forcefully
*
* @return the force preference for push operation
*/
public boolean isForce() {
@ -481,6 +511,7 @@ public boolean isForce() {
* Sets the force preference for push operation.
*
* @param force
* whether to push forcefully
* @return {@code this}
*/
public PushCommand setForce(boolean force) {
@ -493,6 +524,7 @@ public PushCommand setForce(boolean force) {
* Sets the output stream to write sideband messages to
*
* @param out
* an {@link java.io.OutputStream}
* @return {@code this}
* @since 3.0
*/
@ -502,6 +534,8 @@ public PushCommand setOutputStream(OutputStream out) {
}
/**
* Get push options
*
* @return the option strings associated with the push operation
* @since 4.5
*/
@ -510,9 +544,10 @@ public List<String> getPushOptions() {
}
/**
* Sets the option strings associated with the push operation.
* Set the option strings associated with the push operation.
*
* @param pushOptions
* a {@link java.util.List} of push option strings
* @return {@code this}
* @since 4.5
*/

View File

@ -238,7 +238,12 @@ public enum Operation {
private boolean preserveMerges = false;
/**
* <p>
* Constructor for RebaseCommand.
* </p>
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
protected RebaseCommand(Repository repo) {
super(repo);
@ -247,16 +252,12 @@ protected RebaseCommand(Repository repo) {
}
/**
* {@inheritDoc}
* <p>
* Executes the {@code Rebase} command with all the options and parameters
* collected by the setter methods of this class. Each instance of this
* class should only be used for one invocation of the command. Don't call
* this method twice on an instance.
*
* @return an object describing the result of this command
* @throws GitAPIException
* @throws WrongRepositoryStateException
* @throws NoHeadException
* @throws RefNotFoundException
*/
@Override
public RebaseResult call() throws GitAPIException, NoHeadException,
@ -1228,12 +1229,14 @@ private boolean isInteractive() {
}
/**
* checks if we can fast-forward and returns the new head if it is possible
* Check if we can fast-forward and returns the new head if it is possible
*
* @param newCommit
* a {@link org.eclipse.jgit.revwalk.RevCommit} object to check
* if we can fast-forward to.
* @return the new head, or null
* @throws IOException
* @throws GitAPIException
* @throws java.io.IOException
* @throws org.eclipse.jgit.api.errors.GitAPIException
*/
public RevCommit tryFastForward(RevCommit newCommit) throws IOException,
GitAPIException {
@ -1436,6 +1439,8 @@ private boolean checkoutCommit(String headName, RevCommit commit)
/**
* Set upstream {@code RevCommit}
*
* @param upstream
* the upstream commit
* @return {@code this}
@ -1447,6 +1452,8 @@ public RebaseCommand setUpstream(RevCommit upstream) {
}
/**
* Set the upstream commit
*
* @param upstream
* id of the upstream commit
* @return {@code this}
@ -1464,10 +1471,12 @@ public RebaseCommand setUpstream(AnyObjectId upstream) {
}
/**
* Set the upstream branch
*
* @param upstream
* the upstream branch
* the name of the upstream branch
* @return {@code this}
* @throws RefNotFoundException
* @throws org.eclipse.jgit.api.errors.RefNotFoundException
*/
public RebaseCommand setUpstream(String upstream)
throws RefNotFoundException {
@ -1502,6 +1511,8 @@ public RebaseCommand setUpstreamName(String upstreamName) {
}
/**
* Set the operation to execute during rebase
*
* @param operation
* the operation to perform
* @return {@code this}
@ -1512,6 +1523,8 @@ public RebaseCommand setOperation(Operation operation) {
}
/**
* Set progress monitor
*
* @param monitor
* a progress monitor
* @return this instance
@ -1525,15 +1538,18 @@ public RebaseCommand setProgressMonitor(ProgressMonitor monitor) {
}
/**
* Enables interactive rebase
* Enable interactive rebase
* <p>
* Does not stop after initialization of interactive rebase. This is
* equivalent to
* {@link RebaseCommand#runInteractively(InteractiveHandler, boolean)
* {@link org.eclipse.jgit.api.RebaseCommand#runInteractively(InteractiveHandler, boolean)
* runInteractively(handler, false)};
* </p>
*
* @param handler
* the
* {@link org.eclipse.jgit.api.RebaseCommand.InteractiveHandler}
* to use
* @return this
*/
public RebaseCommand runInteractively(InteractiveHandler handler) {
@ -1541,14 +1557,17 @@ public RebaseCommand runInteractively(InteractiveHandler handler) {
}
/**
* Enables interactive rebase
* Enable interactive rebase
* <p>
* If stopAfterRebaseInteractiveInitialization is {@code true} the rebase
* stops after initialization of interactive rebase returning
* {@link RebaseResult#INTERACTIVE_PREPARED_RESULT}
* {@link org.eclipse.jgit.api.RebaseResult#INTERACTIVE_PREPARED_RESULT}
* </p>
*
* @param handler
* the
* {@link org.eclipse.jgit.api.RebaseCommand.InteractiveHandler}
* to use
* @param stopAfterRebaseInteractiveInitialization
* if {@code true} the rebase stops after initialization
* @return this instance
@ -1562,6 +1581,8 @@ public RebaseCommand runInteractively(InteractiveHandler handler,
}
/**
* Set the <code>MergeStrategy</code>.
*
* @param strategy
* The merge strategy to use during this rebase operation.
* @return {@code this}
@ -1573,9 +1594,11 @@ public RebaseCommand setStrategy(MergeStrategy strategy) {
}
/**
* Whether to preserve merges during rebase
*
* @param preserve
* True to re-create merges during rebase. Defaults to false, a
* flattening rebase.
* {@code true} to re-create merges during rebase. Defaults to
* {@code false}, a flattening rebase.
* @return {@code this}
* @since 3.5
*/

View File

@ -45,12 +45,11 @@
import java.util.List;
import java.util.Map;
import org.eclipse.jgit.merge.ResolveMerger;
import org.eclipse.jgit.merge.ResolveMerger.MergeFailureReason;
import org.eclipse.jgit.revwalk.RevCommit;
/**
* The result of a {@link RebaseCommand} execution
* The result of a {@link org.eclipse.jgit.api.RebaseCommand} execution
*/
public class RebaseResult {
/**
@ -279,6 +278,8 @@ static RebaseResult uncommittedChanges(List<String> uncommittedChanges) {
}
/**
* Get the status
*
* @return the overall status
*/
public Status getStatus() {
@ -286,33 +287,46 @@ public Status getStatus() {
}
/**
* @return the current commit if status is {@link Status#STOPPED}, otherwise
* <code>null</code>
* Get the current commit if status is
* {@link org.eclipse.jgit.api.RebaseResult.Status#STOPPED}, otherwise
* <code>null</code>
*
* @return the current commit if status is
* {@link org.eclipse.jgit.api.RebaseResult.Status#STOPPED},
* otherwise <code>null</code>
*/
public RevCommit getCurrentCommit() {
return currentCommit;
}
/**
* Get the list of paths causing this rebase to fail
*
* @return the list of paths causing this rebase to fail (see
* {@link ResolveMerger#getFailingPaths()} for details) if status is
* {@link Status#FAILED}, otherwise <code>null</code>
* {@link org.eclipse.jgit.merge.ResolveMerger#getFailingPaths()}
* for details) if status is
* {@link org.eclipse.jgit.api.RebaseResult.Status#FAILED},
* otherwise <code>null</code>
*/
public Map<String, MergeFailureReason> getFailingPaths() {
return failingPaths;
}
/**
* @return the list of conflicts if status is {@link Status#CONFLICTS}
* Get the list of conflicts
*
* @return the list of conflicts if status is
* {@link org.eclipse.jgit.api.RebaseResult.Status#CONFLICTS}
*/
public List<String> getConflicts() {
return conflicts;
}
/**
* @return the list of uncommitted changes if status is
* {@link Status#UNCOMMITTED_CHANGES}
* <p>Getter for the field <code>uncommittedChanges</code>.</p>
*
* @return the list of uncommitted changes if status is
* {@link org.eclipse.jgit.api.RebaseResult.Status#UNCOMMITTED_CHANGES}
* @since 3.2
*/
public List<String> getUncommittedChanges() {

View File

@ -67,7 +67,10 @@ public class ReflogCommand extends GitCommand<Collection<ReflogEntry>> {
private String ref = Constants.HEAD;
/**
* Constructor for ReflogCommand.
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
public ReflogCommand(Repository repo) {
super(repo);
@ -78,6 +81,7 @@ public ReflogCommand(Repository repo) {
* value of HEAD will be used.
*
* @param ref
* the name of the {@code Ref} to log
* @return {@code this}
*/
public ReflogCommand setRef(String ref) {
@ -87,10 +91,9 @@ public ReflogCommand setRef(String ref) {
}
/**
* {@inheritDoc}
* <p>
* Run the reflog command
*
* @throws GitAPIException
* @throws InvalidRefNameException
*/
@Override
public Collection<ReflogEntry> call() throws GitAPIException,

View File

@ -63,7 +63,6 @@
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-remote.html" > Git
* documentation about Remote</a>
*
* @since 4.2
*/
public class RemoteAddCommand extends GitCommand<RemoteConfig> {
@ -73,7 +72,10 @@ public class RemoteAddCommand extends GitCommand<RemoteConfig> {
private URIish uri;
/**
* Constructor for RemoteAddCommand.
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
protected RemoteAddCommand(Repository repo) {
super(repo);
@ -100,10 +102,10 @@ public void setUri(URIish uri) {
}
/**
* {@inheritDoc}
* <p>
* Executes the {@code remote add} command with all the options and
* parameters collected by the setter methods of this class.
*
* @return the {@link RemoteConfig} object of the added remote
*/
@Override
public RemoteConfig call() throws GitAPIException {

View File

@ -59,23 +59,27 @@
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-remote.html" > Git
* documentation about Remote</a>
*
* @since 4.2
*/
public class RemoteListCommand extends GitCommand<List<RemoteConfig>> {
/**
* <p>
* Constructor for RemoteListCommand.
* </p>
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
protected RemoteListCommand(Repository repo) {
super(repo);
}
/**
* {@inheritDoc}
* <p>
* Executes the {@code remote} command with all the options and parameters
* collected by the setter methods of this class.
*
* @return a list of {@link RemoteConfig} objects.
*/
@Override
public List<RemoteConfig> call() throws GitAPIException {

View File

@ -61,7 +61,6 @@
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-remote.html" > Git
* documentation about Remote</a>
*
* @since 4.2
*/
public class RemoteRemoveCommand extends GitCommand<RemoteConfig> {
@ -69,7 +68,12 @@ public class RemoteRemoveCommand extends GitCommand<RemoteConfig> {
private String name;
/**
* <p>
* Constructor for RemoteRemoveCommand.
* </p>
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
protected RemoteRemoveCommand(Repository repo) {
super(repo);
@ -86,10 +90,10 @@ public void setName(String name) {
}
/**
* {@inheritDoc}
* <p>
* Executes the {@code remote} command with all the options and parameters
* collected by the setter methods of this class.
*
* @return the {@link RemoteConfig} object of the removed remote
*/
@Override
public RemoteConfig call() throws GitAPIException {

View File

@ -62,7 +62,6 @@
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-remote.html" > Git
* documentation about Remote</a>
*
* @since 4.2
*/
public class RemoteSetUrlCommand extends GitCommand<RemoteConfig> {
@ -74,7 +73,12 @@ public class RemoteSetUrlCommand extends GitCommand<RemoteConfig> {
private boolean push;
/**
* <p>
* Constructor for RemoteSetUrlCommand.
* </p>
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
protected RemoteSetUrlCommand(Repository repo) {
super(repo);
@ -112,10 +116,10 @@ public void setPush(boolean push) {
}
/**
* {@inheritDoc}
* <p>
* Executes the {@code remote} command with all the options and parameters
* collected by the setter methods of this class.
*
* @return the {@link RemoteConfig} object of the modified remote
*/
@Override
public RemoteConfig call() throws GitAPIException {

View File

@ -73,12 +73,18 @@ public class RemoveNoteCommand extends GitCommand<Note> {
private String notesRef = Constants.R_NOTES_COMMITS;
/**
* <p>
* Constructor for RemoveNoteCommand.
* </p>
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
protected RemoveNoteCommand(Repository repo) {
super(repo);
}
/** {@inheritDoc} */
@Override
public Note call() throws GitAPIException {
checkCallable();
@ -105,6 +111,8 @@ public Note call() throws GitAPIException {
* Sets the object id of object you want to remove a note
*
* @param id
* the {@link org.eclipse.jgit.revwalk.RevObject} to remove a
* note from.
* @return {@code this}
*/
public RemoveNoteCommand setObjectId(RevObject id) {
@ -138,12 +146,13 @@ private void commitNoteMap(RevWalk walk, NoteMap map,
}
/**
* @param notesRef
* the ref to read notes from. Note, the default value of
* {@link Constants#R_NOTES_COMMITS} will be used if nothing is
* set
* @return {@code this}
* Set the name of the <code>Ref</code> to remove a note from.
*
* @param notesRef
* the {@code Ref} to read notes from. Note, the default value of
* {@link org.eclipse.jgit.lib.Constants#R_NOTES_COMMITS} will be
* used if nothing is set
* @return {@code this}
* @see Constants#R_NOTES_COMMITS
*/
public RemoveNoteCommand setNotesRef(String notesRef) {

View File

@ -77,25 +77,18 @@ public class RenameBranchCommand extends GitCommand<Ref> {
private String newName;
/**
* <p>
* Constructor for RenameBranchCommand.
* </p>
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
protected RenameBranchCommand(Repository repo) {
super(repo);
}
/**
* @throws RefNotFoundException
* if the old branch can not be found (branch with provided old
* name does not exist or old name resolves to a tag)
* @throws InvalidRefNameException
* if the provided new name is <code>null</code> or otherwise
* invalid
* @throws RefAlreadyExistsException
* if a branch with the new name already exists
* @throws DetachedHeadException
* if rename is tried without specifying the old name and HEAD
* is detached
*/
/** {@inheritDoc} */
@Override
public Ref call() throws GitAPIException, RefNotFoundException, InvalidRefNameException,
RefAlreadyExistsException, DetachedHeadException {
@ -198,6 +191,8 @@ public Ref call() throws GitAPIException, RefNotFoundException, InvalidRefNameEx
}
/**
* Set the new name of the branch
*
* @param newName
* the new name
* @return this instance
@ -209,6 +204,8 @@ public RenameBranchCommand setNewName(String newName) {
}
/**
* Set the old name of the branch
*
* @param oldName
* the name of the branch to rename; if not set, the currently
* checked out branch (if any) will be renamed

View File

@ -126,20 +126,23 @@ public enum ResetType {
private boolean isReflogDisabled;
/**
* <p>
* Constructor for ResetCommand.
* </p>
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
public ResetCommand(Repository repo) {
super(repo);
}
/**
* {@inheritDoc}
* <p>
* Executes the {@code Reset} command. Each instance of this class should
* only be used for one invocation of the command. Don't call this method
* twice on an instance.
*
* @return the Ref after reset
* @throws GitAPIException
*/
@Override
public Ref call() throws GitAPIException, CheckoutConflictException {
@ -258,6 +261,8 @@ private ObjectId resolveRefToCommitId() {
}
/**
* Set the name of the <code>Ref</code> to reset to
*
* @param ref
* the ref to reset to, defaults to HEAD if not specified
* @return this instance
@ -268,6 +273,8 @@ public ResetCommand setRef(String ref) {
}
/**
* Set the reset mode
*
* @param mode
* the mode of the reset command
* @return this instance
@ -282,6 +289,8 @@ public ResetCommand setMode(ResetType mode) {
}
/**
* Repository relative path of file or directory to reset
*
* @param path
* repository-relative path of file/directory to reset (with
* <code>/</code> as separator)
@ -297,6 +306,8 @@ public ResetCommand addPath(String path) {
}
/**
* Whether to disable reflog
*
* @param disable
* if {@code true} disables writing a reflog entry for this reset
* command
@ -309,6 +320,8 @@ public ResetCommand disableRefLog(boolean disable) {
}
/**
* Whether reflog is disabled
*
* @return {@code true} if writing reflog is disabled for this reset command
* @since 4.5
*/
@ -433,6 +446,7 @@ private void resetRevert() throws IOException {
repo.writeMergeCommitMsg(null);
}
/** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {

View File

@ -98,27 +98,24 @@ public class RevertCommand extends GitCommand<RevCommit> {
private MergeStrategy strategy = MergeStrategy.RECURSIVE;
/**
* <p>
* Constructor for RevertCommand.
* </p>
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
protected RevertCommand(Repository repo) {
super(repo);
}
/**
* {@inheritDoc}
* <p>
* Executes the {@code revert} command with all the options and parameters
* collected by the setter methods (e.g. {@link #include(Ref)} of this
* class. Each instance of this class should only be used for one invocation
* of the command. Don't call this method twice on an instance.
*
* @return on success the {@link RevCommit} pointed to by the new HEAD is
* returned. If a failure occurred during revert <code>null</code>
* is returned. The list of successfully reverted {@link Ref}'s can
* be obtained by calling {@link #getRevertedRefs()}
* @throws GitAPIException
* @throws WrongRepositoryStateException
* @throws ConcurrentRefUpdateException
* @throws UnmergedPathsException
* @throws NoMessageException
*/
@Override
public RevCommit call() throws NoMessageException, UnmergedPathsException,
@ -227,9 +224,10 @@ public RevCommit call() throws NoMessageException, UnmergedPathsException,
}
/**
* Include a {@code Ref} to a commit to be reverted
*
* @param commit
* a reference to a commit which is reverted into the current
* head
* a reference to a commit to be reverted into the current head
* @return {@code this}
*/
public RevertCommand include(Ref commit) {
@ -239,8 +237,10 @@ public RevertCommand include(Ref commit) {
}
/**
* Include a commit to be reverted
*
* @param commit
* the Id of a commit which is reverted into the current head
* the Id of a commit to be reverted into the current head
* @return {@code this}
*/
public RevertCommand include(AnyObjectId commit) {
@ -248,8 +248,10 @@ public RevertCommand include(AnyObjectId commit) {
}
/**
* Include a commit to be reverted
*
* @param name
* a name given to the commit
* name of a {@code Ref} referring to the commit
* @param commit
* the Id of a commit which is reverted into the current head
* @return {@code this}
@ -260,6 +262,8 @@ public RevertCommand include(String name, AnyObjectId commit) {
}
/**
* Set the name to be used in the "OURS" place for conflict markers
*
* @param ourCommitName
* the name that should be used in the "OURS" place for conflict
* markers
@ -280,16 +284,20 @@ private String calculateOurName(Ref headRef) {
}
/**
* @return the list of successfully reverted {@link Ref}'s. Never
* <code>null</code> but maybe an empty list if no commit was
* successfully cherry-picked
* Get the list of successfully reverted {@link org.eclipse.jgit.lib.Ref}'s.
*
* @return the list of successfully reverted
* {@link org.eclipse.jgit.lib.Ref}'s. Never <code>null</code> but
* maybe an empty list if no commit was successfully cherry-picked
*/
public List<Ref> getRevertedRefs() {
return revertedRefs;
}
/**
* @return the result of the merge failure, <code>null</code> if no merge
* Get the result of a merge failure
*
* @return the result of a merge failure, <code>null</code> if no merge
* failure occurred during the revert
*/
public MergeResult getFailingResult() {
@ -297,6 +305,8 @@ public MergeResult getFailingResult() {
}
/**
* Get unmerged paths
*
* @return the unmerged paths, will be null if no merge conflicts
*/
public List<String> getUnmergedPaths() {
@ -304,8 +314,10 @@ public List<String> getUnmergedPaths() {
}
/**
* Set the merge strategy to use for this revert command
*
* @param strategy
* The merge strategy to use during this revert command.
* The merge strategy to use for this revert command.
* @return {@code this}
* @since 3.4
*/

View File

@ -72,7 +72,7 @@
* class should only be used for one invocation of the command (means: one call
* to {@link #call()}).
* <p>
* Examples (<code>git</code> is a {@link Git} instance):
* Examples (<code>git</code> is a {@link org.eclipse.jgit.api.Git} instance):
* <p>
* Remove file "test.txt" from both index and working directory:
*
@ -97,8 +97,10 @@ public class RmCommand extends GitCommand<DirCache> {
private boolean cached = false;
/**
* Constructor for RmCommand.
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
public RmCommand(Repository repo) {
super(repo);
@ -106,6 +108,8 @@ public RmCommand(Repository repo) {
}
/**
* Add file name pattern of files to be removed
*
* @param filepattern
* repository-relative path of file to remove (with
* <code>/</code> as separator)
@ -121,8 +125,9 @@ public RmCommand addFilepattern(String filepattern) {
* Only remove the specified files from the index.
*
* @param cached
* true if files should only be removed from index, false if
* files should also be deleted from the working directory
* {@code true} if files should only be removed from index,
* {@code false} if files should also be deleted from the working
* directory
* @return {@code this}
* @since 2.2
*/
@ -133,11 +138,11 @@ public RmCommand setCached(boolean cached) {
}
/**
* {@inheritDoc}
* <p>
* Executes the {@code Rm} command. Each instance of this class should only
* be used for one invocation of the command. Don't call this method twice
* on an instance.
*
* @return the DirCache after Rm
*/
@Override
public DirCache call() throws GitAPIException,

View File

@ -68,12 +68,16 @@ public class ShowNoteCommand extends GitCommand<Note> {
private String notesRef = Constants.R_NOTES_COMMITS;
/**
* Constructor for ShowNoteCommand.
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository}
*/
protected ShowNoteCommand(Repository repo) {
super(repo);
}
/** {@inheritDoc} */
@Override
public Note call() throws GitAPIException {
checkCallable();
@ -96,6 +100,8 @@ public Note call() throws GitAPIException {
* Sets the object id of object you want a note on
*
* @param id
* the {@link org.eclipse.jgit.revwalk.RevObject} to show notes
* for.
* @return {@code this}
*/
public ShowNoteCommand setObjectId(RevObject id) {
@ -105,12 +111,13 @@ public ShowNoteCommand setObjectId(RevObject id) {
}
/**
* Set the {@code Ref} to read notes from.
*
* @param notesRef
* the ref to read notes from. Note, the default value of
* {@link Constants#R_NOTES_COMMITS} will be used if nothing is
* set
* {@link org.eclipse.jgit.lib.Constants#R_NOTES_COMMITS} will be
* used if nothing is set
* @return {@code this}
*
* @see Constants#R_NOTES_COMMITS
*/
public ShowNoteCommand setNotesRef(String notesRef) {

View File

@ -88,7 +88,6 @@
*
* @see <a href="http://www.kernel.org/pub/software/scm/git/docs/git-stash.html"
* >Git documentation about Stash</a>
*
* @since 2.0
*/
public class StashApplyCommand extends GitCommand<ObjectId> {
@ -109,6 +108,8 @@ public class StashApplyCommand extends GitCommand<ObjectId> {
* Create command to apply the changes of a stashed commit
*
* @param repo
* the {@link org.eclipse.jgit.lib.Repository} to apply the stash
* to
*/
public StashApplyCommand(final Repository repo) {
super(repo);
@ -121,6 +122,7 @@ public StashApplyCommand(final Repository repo) {
* unspecified
*
* @param stashRef
* name of the stash {@code Ref} to apply
* @return {@code this}
*/
public StashApplyCommand setStashRef(final String stashRef) {
@ -129,7 +131,10 @@ public StashApplyCommand setStashRef(final String stashRef) {
}
/**
* Whether to ignore the repository state when applying the stash
*
* @param willIgnoreRepositoryState
* whether to ignore the repository state when applying the stash
* @return {@code this}
* @since 3.2
*/
@ -154,14 +159,9 @@ private ObjectId getStashId() throws GitAPIException {
}
/**
* {@inheritDoc}
* <p>
* Apply the changes in a stashed commit to the working directory and index
*
* @return id of stashed commit that was applied TODO: Does anyone depend on
* this, or could we make it more like Merge/CherryPick/Revert?
* @throws GitAPIException
* @throws WrongRepositoryStateException
* @throws NoHeadException
* @throws StashApplyFailureException
*/
@Override
public ObjectId call() throws GitAPIException,
@ -273,6 +273,8 @@ public ObjectId call() throws GitAPIException,
}
/**
* Whether to restore the index state
*
* @param applyIndex
* true (default) if the command should restore the index state
*/
@ -281,6 +283,8 @@ public void setApplyIndex(boolean applyIndex) {
}
/**
* Set the <code>MergeStrategy</code> to use.
*
* @param strategy
* The merge strategy to use in order to merge during this
* command execution.
@ -293,6 +297,8 @@ public StashApplyCommand setStrategy(MergeStrategy strategy) {
}
/**
* Whether the command should restore untracked files
*
* @param applyUntracked
* true (default) if the command should restore untracked files
* @since 3.4

View File

@ -115,6 +115,7 @@ public class StashCreateCommand extends GitCommand<RevCommit> {
* Create a command to stash changes in the working directory and index
*
* @param repo
* a {@link org.eclipse.jgit.lib.Repository} object.
*/
public StashCreateCommand(Repository repo) {
super(repo);
@ -128,6 +129,7 @@ public StashCreateCommand(Repository repo) {
* id, and short commit message when used.
*
* @param message
* the stash message
* @return {@code this}
*/
public StashCreateCommand setIndexMessage(String message) {
@ -142,6 +144,7 @@ public StashCreateCommand setIndexMessage(String message) {
* id, and short commit message when used.
*
* @param message
* the working directory message
* @return {@code this}
*/
public StashCreateCommand setWorkingDirectoryMessage(String message) {
@ -153,6 +156,8 @@ public StashCreateCommand setWorkingDirectoryMessage(String message) {
* Set the person to use as the author and committer in the commits made
*
* @param person
* the {@link org.eclipse.jgit.lib.PersonIdent} of the person who
* creates the stash.
* @return {@code this}
*/
public StashCreateCommand setPerson(PersonIdent person) {
@ -161,12 +166,13 @@ public StashCreateCommand setPerson(PersonIdent person) {
}
/**
* Set the reference to update with the stashed commit id
* If null, no reference is updated
* Set the reference to update with the stashed commit id If null, no
* reference is updated
* <p>
* This value defaults to {@link Constants#R_STASH}
* This value defaults to {@link org.eclipse.jgit.lib.Constants#R_STASH}
*
* @param ref
* the name of the {@code Ref} to update
* @return {@code this}
*/
public StashCreateCommand setRef(String ref) {
@ -178,6 +184,7 @@ public StashCreateCommand setRef(String ref) {
* Whether to include untracked files in the stash.
*
* @param includeUntracked
* whether to include untracked files in the stash
* @return {@code this}
* @since 3.4
*/
@ -232,11 +239,10 @@ private Ref getHead() throws GitAPIException {
}
/**
* {@inheritDoc}
* <p>
* Stash the contents on the working directory and index in separate commits
* and reset to the current HEAD commit.
*
* @return stashed commit or null if no changes to stash
* @throws GitAPIException
*/
@Override
public RevCommit call() throws GitAPIException {

View File

@ -84,7 +84,10 @@ public class StashDropCommand extends GitCommand<ObjectId> {
private boolean all;
/**
* Constructor for StashDropCommand.
*
* @param repo
* a {@link org.eclipse.jgit.lib.Repository} object.
*/
public StashDropCommand(Repository repo) {
super(repo);
@ -101,6 +104,7 @@ public StashDropCommand(Repository repo) {
* unspecified
*
* @param stashRef
* the 0-based index of the stash reference
* @return {@code this}
*/
public StashDropCommand setStashRef(final int stashRef) {
@ -112,11 +116,12 @@ public StashDropCommand setStashRef(final int stashRef) {
}
/**
* Set wheter drop all stashed commits
* Set whether to drop all stashed commits
*
* @param all
* true to drop all stashed commits, false to drop only the
* stashed commit set via calling {@link #setStashRef(int)}
* {@code true} to drop all stashed commits, {@code false} to
* drop only the stashed commit set via calling
* {@link #setStashRef(int)}
* @return {@code this}
*/
public StashDropCommand setAll(final boolean all) {
@ -173,11 +178,10 @@ private void updateRef(Ref stashRef, ObjectId newId) {
}
/**
* {@inheritDoc}
* <p>
* Drop the configured entry from the stash reflog and return value of the
* stash reference after the drop occurs
*
* @return commit id of stash reference or null if no more stashed changes
* @throws GitAPIException
*/
@Override
public ObjectId call() throws GitAPIException {

View File

@ -70,12 +70,13 @@ public class StashListCommand extends GitCommand<Collection<RevCommit>> {
/**
* Create a new stash list command
*
* @param repo
* @param repo a {@link org.eclipse.jgit.lib.Repository} object.
*/
public StashListCommand(final Repository repo) {
super(repo);
}
/** {@inheritDoc} */
@Override
public Collection<RevCommit> call() throws GitAPIException,
InvalidRefNameException {

View File

@ -70,7 +70,10 @@ public class Status {
private final boolean hasUncommittedChanges;
/**
* Constructor for Status.
*
* @param diff
* the {@link org.eclipse.jgit.lib.IndexDiff} having the status
*/
public Status(IndexDiff diff) {
super();
@ -86,16 +89,20 @@ public Status(IndexDiff diff) {
}
/**
* @return true if no differences exist between the working-tree, the index,
* and the current HEAD, false if differences do exist
* Whether the status is clean
*
* @return {@code true} if no differences exist between the working-tree,
* the index, and the current HEAD, {@code false} if differences do
* exist
*/
public boolean isClean() {
return clean;
}
/**
* @return true if any tracked file is changed
* Whether there are uncommitted changes
*
* @return {@code true} if any tracked file is changed
* @since 3.2
*/
public boolean hasUncommittedChanges() {
@ -103,14 +110,18 @@ public boolean hasUncommittedChanges() {
}
/**
* Get files added to the index
*
* @return list of files added to the index, not in HEAD (e.g. what you get
* if you call 'git add ...' on a newly created file)
* if you call {@code git add ...} on a newly created file)
*/
public Set<String> getAdded() {
return Collections.unmodifiableSet(diff.getAdded());
}
/**
* Get changed files from HEAD to index
*
* @return list of files changed from HEAD to index (e.g. what you get if
* you modify an existing file and call 'git add ...' on it)
*/
@ -119,6 +130,8 @@ public Set<String> getChanged() {
}
/**
* Get removed files
*
* @return list of files removed from index, but in HEAD (e.g. what you get
* if you call 'git rm ...' on a existing file)
*/
@ -127,6 +140,8 @@ public Set<String> getRemoved() {
}
/**
* Get missing files
*
* @return list of files in index, but not filesystem (e.g. what you get if
* you call 'rm ...' on a existing file)
*/
@ -135,6 +150,8 @@ public Set<String> getMissing() {
}
/**
* Get modified files relative to the index
*
* @return list of files modified on disk relative to the index (e.g. what
* you get if you modify an existing file without adding it to the
* index)
@ -144,6 +161,8 @@ public Set<String> getModified() {
}
/**
* Get untracked files
*
* @return list of files that are not ignored, and not in the index. (e.g.
* what you get if you create a new file without adding it to the
* index)
@ -153,6 +172,8 @@ public Set<String> getUntracked() {
}
/**
* Get untracked folders
*
* @return set of directories that are not ignored, and not in the index.
*/
public Set<String> getUntrackedFolders() {
@ -160,6 +181,8 @@ public Set<String> getUntrackedFolders() {
}
/**
* Get conflicting files
*
* @return list of files that are in conflict. (e.g what you get if you
* modify file that was modified by someone else in the meantime)
*/
@ -168,7 +191,10 @@ public Set<String> getConflicting() {
}
/**
* @return a map from conflicting path to its {@link StageState}.
* Get StageState of conflicting files
*
* @return a map from conflicting path to its
* {@link org.eclipse.jgit.lib.IndexDiff.StageState}.
* @since 3.0
*/
public Map<String, StageState> getConflictingStageState() {
@ -176,6 +202,8 @@ public Map<String, StageState> getConflictingStageState() {
}
/**
* Get ignored files which are not in the index
*
* @return set of files and folders that are ignored and not in the index.
*/
public Set<String> getIgnoredNotInIndex() {
@ -183,9 +211,11 @@ public Set<String> getIgnoredNotInIndex() {
}
/**
* Get uncommitted changes, i.e. all files changed in the index or working
* tree
*
* @return set of files and folders that are known to the repo and changed
* either in the index or in the working tree.
*
* @since 3.2
*/
public Set<String> getUncommittedChanges() {

View File

@ -64,9 +64,9 @@
* to finally execute the command. Each instance of this class should only be
* used for one invocation of the command (means: one call to {@link #call()})
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-status.html"
* >Git documentation about Status</a>
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-status.html" >Git
* documentation about Status</a>
*/
public class StatusCommand extends GitCommand<Status> {
private WorkingTreeIterator workingTreeIt;
@ -76,14 +76,21 @@ public class StatusCommand extends GitCommand<Status> {
private IgnoreSubmoduleMode ignoreSubmoduleMode = null;
/**
* Constructor for StatusCommand.
*
* @param repo
* a {@link org.eclipse.jgit.lib.Repository} object.
*/
protected StatusCommand(Repository repo) {
super(repo);
}
/**
* Whether to ignore submodules
*
* @param mode
* the
* {@link org.eclipse.jgit.submodule.SubmoduleWalk.IgnoreSubmoduleMode}
* @return {@code this}
* @since 3.6
*/
@ -126,13 +133,12 @@ public List<String> getPaths() {
}
/**
* {@inheritDoc}
* <p>
* Executes the {@code Status} command with all the options and parameters
* collected by the setter methods of this class. Each instance of this
* class should only be used for one invocation of the command. Don't call
* this method twice on an instance.
*
* @return a {@link Status} object telling about each path where working
* tree, index or HEAD differ from each other.
*/
@Override
public Status call() throws GitAPIException, NoWorkTreeException {
@ -157,8 +163,9 @@ public Status call() throws GitAPIException, NoWorkTreeException {
}
/**
* To set the {@link WorkingTreeIterator} which should be used. If this
* method is not called a standard {@link FileTreeIterator} is used.
* To set the {@link org.eclipse.jgit.treewalk.WorkingTreeIterator} which
* should be used. If this method is not called a standard
* {@link org.eclipse.jgit.treewalk.FileTreeIterator} is used.
*
* @param workingTreeIt
* a working tree iterator
@ -170,10 +177,11 @@ public StatusCommand setWorkingTreeIt(WorkingTreeIterator workingTreeIt) {
}
/**
* To set the {@link ProgressMonitor} which contains callback methods to
* inform you about the progress of this command.
* To set the {@link org.eclipse.jgit.lib.ProgressMonitor} which contains
* callback methods to inform you about the progress of this command.
*
* @param progressMonitor
* a {@link org.eclipse.jgit.lib.ProgressMonitor} object.
* @return {@code this}
* @since 3.1
*/

View File

@ -69,8 +69,8 @@
* .gitmodules file and the repository config file, and also add the submodule
* and .gitmodules file to the index.
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-submodule.html"
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-submodule.html"
* >Git documentation about submodules</a>
*/
public class SubmoduleAddCommand extends
@ -83,7 +83,10 @@ public class SubmoduleAddCommand extends
private ProgressMonitor monitor;
/**
* Constructor for SubmoduleAddCommand.
*
* @param repo
* a {@link org.eclipse.jgit.lib.Repository} object.
*/
public SubmoduleAddCommand(final Repository repo) {
super(repo);
@ -105,6 +108,7 @@ public SubmoduleAddCommand setPath(final String path) {
* Set URI to clone submodule from
*
* @param uri
* a {@link java.lang.String} object.
* @return this command
*/
public SubmoduleAddCommand setURI(final String uri) {
@ -118,6 +122,7 @@ public SubmoduleAddCommand setURI(final String uri) {
*
* @see NullProgressMonitor
* @param monitor
* a {@link org.eclipse.jgit.lib.ProgressMonitor} object.
* @return this command
*/
public SubmoduleAddCommand setProgressMonitor(final ProgressMonitor monitor) {
@ -129,7 +134,7 @@ public SubmoduleAddCommand setProgressMonitor(final ProgressMonitor monitor) {
* Is the configured already a submodule in the index?
*
* @return true if submodule exists in index, false otherwise
* @throws IOException
* @throws java.io.IOException
*/
protected boolean submoduleExists() throws IOException {
TreeFilter filter = PathFilter.create(path);
@ -139,15 +144,14 @@ protected boolean submoduleExists() throws IOException {
}
/**
* {@inheritDoc}
* <p>
* Executes the {@code SubmoduleAddCommand}
*
* The {@code Repository} instance returned by this command needs to be
* closed by the caller to free resources held by the {@code Repository}
* instance. It is recommended to call this method as soon as you don't need
* a reference to this {@code Repository} instance anymore.
*
* @return the newly created {@link Repository}
* @throws GitAPIException
*/
@Override
public Repository call() throws GitAPIException {

View File

@ -63,8 +63,8 @@
* .gitmodules file to a repository's config file for each submodule not
* currently present in the repository's config file.
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-submodule.html"
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-submodule.html"
* >Git documentation about submodules</a>
*/
public class SubmoduleInitCommand extends GitCommand<Collection<String>> {
@ -72,7 +72,10 @@ public class SubmoduleInitCommand extends GitCommand<Collection<String>> {
private final Collection<String> paths;
/**
* Constructor for SubmoduleInitCommand.
*
* @param repo
* a {@link org.eclipse.jgit.lib.Repository} object.
*/
public SubmoduleInitCommand(final Repository repo) {
super(repo);
@ -91,6 +94,7 @@ public SubmoduleInitCommand addPath(final String path) {
return this;
}
/** {@inheritDoc} */
@Override
public Collection<String> call() throws GitAPIException {
checkCallable();

View File

@ -62,8 +62,8 @@
/**
* A class used to execute a submodule status command.
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-submodule.html"
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-submodule.html"
* >Git documentation about submodules</a>
*/
public class SubmoduleStatusCommand extends
@ -72,7 +72,10 @@ public class SubmoduleStatusCommand extends
private final Collection<String> paths;
/**
* Constructor for SubmoduleStatusCommand.
*
* @param repo
* a {@link org.eclipse.jgit.lib.Repository} object.
*/
public SubmoduleStatusCommand(final Repository repo) {
super(repo);
@ -91,6 +94,7 @@ public SubmoduleStatusCommand addPath(final String path) {
return this;
}
/** {@inheritDoc} */
@Override
public Map<String, SubmoduleStatus> call() throws GitAPIException {
checkCallable();

View File

@ -65,8 +65,8 @@
* This will set the remote URL in a submodule's repository to the current value
* in the .gitmodules file.
*
* @see <a
* href="http://www.kernel.org/pub/software/scm/git/docs/git-submodule.html"
* @see <a href=
* "http://www.kernel.org/pub/software/scm/git/docs/git-submodule.html"
* >Git documentation about submodules</a>
*/
public class SubmoduleSyncCommand extends GitCommand<Map<String, String>> {
@ -74,7 +74,10 @@ public class SubmoduleSyncCommand extends GitCommand<Map<String, String>> {
private final Collection<String> paths;
/**
* Constructor for SubmoduleSyncCommand.
*
* @param repo
* a {@link org.eclipse.jgit.lib.Repository} object.
*/
public SubmoduleSyncCommand(final Repository repo) {
super(repo);
@ -97,8 +100,9 @@ public SubmoduleSyncCommand addPath(final String path) {
* Get branch that HEAD currently points to
*
* @param subRepo
* a {@link org.eclipse.jgit.lib.Repository} object.
* @return shortened branch name, null on failures
* @throws IOException
* @throws java.io.IOException
*/
protected String getHeadBranch(final Repository subRepo) throws IOException {
Ref head = subRepo.exactRef(Constants.HEAD);
@ -108,6 +112,7 @@ protected String getHeadBranch(final Repository subRepo) throws IOException {
return null;
}
/** {@inheritDoc} */
@Override
public Map<String, String> call() throws GitAPIException {
checkCallable();

View File

@ -96,7 +96,12 @@ public class SubmoduleUpdateCommand extends
private boolean fetch = false;
/**
* <p>
* Constructor for SubmoduleUpdateCommand.
* </p>
*
* @param repo
* a {@link org.eclipse.jgit.lib.Repository} object.
*/
public SubmoduleUpdateCommand(final Repository repo) {
super(repo);
@ -109,6 +114,7 @@ public SubmoduleUpdateCommand(final Repository repo) {
*
* @see NullProgressMonitor
* @param monitor
* a {@link org.eclipse.jgit.lib.ProgressMonitor} object.
* @return this command
*/
public SubmoduleUpdateCommand setProgressMonitor(
@ -122,6 +128,7 @@ public SubmoduleUpdateCommand setProgressMonitor(
* is set to <code>false</code>
*
* @param fetch
* whether to fetch the submodules before we update them
* @return this command
* @since 4.9
*/
@ -143,18 +150,9 @@ public SubmoduleUpdateCommand addPath(final String path) {
}
/**
* Execute the SubmoduleUpdateCommand command.
* {@inheritDoc}
*
* @return a collection of updated submodule paths
* @throws ConcurrentRefUpdateException
* @throws CheckoutConflictException
* @throws InvalidMergeHeadsException
* @throws InvalidConfigurationException
* @throws NoHeadException
* @throws NoMessageException
* @throws RefNotFoundException
* @throws WrongRepositoryStateException
* @throws GitAPIException
* Execute the SubmoduleUpdateCommand command.
*/
@Override
public Collection<String> call() throws InvalidConfigurationException,
@ -252,6 +250,8 @@ public Collection<String> call() throws InvalidConfigurationException,
}
/**
* Setter for the field <code>strategy</code>.
*
* @param strategy
* The merge strategy to use during this update operation.
* @return {@code this}

View File

@ -68,7 +68,7 @@
/**
* Create/update an annotated tag object or a simple unannotated tag
* <p>
* Examples (<code>git</code> is a {@link Git} instance):
* Examples (<code>git</code> is a {@link org.eclipse.jgit.api.Git} instance):
* <p>
* Create a new tag for the current commit:
*
@ -104,21 +104,22 @@ public class TagCommand extends GitCommand<Ref> {
private boolean annotated = true;
/**
* @param repo
* <p>Constructor for TagCommand.</p>
*
* @param repo a {@link org.eclipse.jgit.lib.Repository} object.
*/
protected TagCommand(Repository repo) {
super(repo);
}
/**
* {@inheritDoc}
* <p>
* Executes the {@code tag} command with all the options and parameters
* collected by the setter methods of this class. Each instance of this
* class should only be used for one invocation of the command (means: one
* call to {@link #call()})
*
* @return a {@link Ref} a ref pointing to a tag
* @throws NoHeadException
* when called on a git repo without a HEAD reference
* @since 2.0
*/
@Override
@ -226,6 +227,8 @@ private void processOptions(RepositoryState state)
}
/**
* Set the tag <code>name</code>.
*
* @param name
* the tag name used for the {@code tag}
* @return {@code this}
@ -237,6 +240,8 @@ public TagCommand setName(String name) {
}
/**
* Get the tag <code>name</code>.
*
* @return the tag name used for the <code>tag</code>
*/
public String getName() {
@ -244,6 +249,8 @@ public String getName() {
}
/**
* Get the tag <code>message</code>.
*
* @return the tag message used for the <code>tag</code>
*/
public String getMessage() {
@ -251,6 +258,8 @@ public String getMessage() {
}
/**
* Set the tag <code>message</code>.
*
* @param message
* the tag message used for the {@code tag}
* @return {@code this}
@ -262,6 +271,8 @@ public TagCommand setMessage(String message) {
}
/**
* Whether this tag is signed
*
* @return whether the tag is signed
*/
public boolean isSigned() {
@ -273,6 +284,7 @@ public boolean isSigned() {
* corresponds to the parameter -s on the command line.
*
* @param signed
* a boolean.
* @return {@code this}
*/
public TagCommand setSigned(boolean signed) {
@ -285,6 +297,7 @@ public TagCommand setSigned(boolean signed) {
* created from the info in the repository.
*
* @param tagger
* a {@link org.eclipse.jgit.lib.PersonIdent} object.
* @return {@code this}
*/
public TagCommand setTagger(PersonIdent tagger) {
@ -293,6 +306,8 @@ public TagCommand setTagger(PersonIdent tagger) {
}
/**
* Get the <code>tagger</code> who created the tag.
*
* @return the tagger of the tag
*/
public PersonIdent getTagger() {
@ -300,6 +315,8 @@ public PersonIdent getTagger() {
}
/**
* Get the tag's object id
*
* @return the object id of the tag
*/
public RevObject getObjectId() {
@ -311,6 +328,7 @@ public RevObject getObjectId() {
* pointed to from HEAD will be used.
*
* @param id
* a {@link org.eclipse.jgit.revwalk.RevObject} object.
* @return {@code this}
*/
public TagCommand setObjectId(RevObject id) {
@ -319,6 +337,8 @@ public TagCommand setObjectId(RevObject id) {
}
/**
* Whether this is a forced update
*
* @return is this a force update
*/
public boolean isForceUpdate() {
@ -330,6 +350,7 @@ public boolean isForceUpdate() {
* corresponds to the parameter -f on the command line.
*
* @param forceUpdate
* whether this is a forced update
* @return {@code this}
*/
public TagCommand setForceUpdate(boolean forceUpdate) {
@ -338,7 +359,10 @@ public TagCommand setForceUpdate(boolean forceUpdate) {
}
/**
* Configure this tag to be created as an annotated tag
*
* @param annotated
* whether this shall be an annotated tag
* @return {@code this}
* @since 3.0
*/
@ -348,6 +372,8 @@ public TagCommand setAnnotated(boolean annotated) {
}
/**
* Whether this will create an annotated command
*
* @return true if this command will create an annotated tag (default is
* true)
* @since 3.0

View File

@ -47,11 +47,12 @@
import org.eclipse.jgit.transport.Transport;
/**
* Base class for commands that use a {@link Transport} during execution.
* Base class for commands that use a
* {@link org.eclipse.jgit.transport.Transport} during execution.
* <p>
* This class provides standard configuration of a transport for options such as
* a {@link CredentialsProvider}, a timeout, and a
* {@link TransportConfigCallback}.
* a {@link org.eclipse.jgit.transport.CredentialsProvider}, a timeout, and a
* {@link org.eclipse.jgit.api.TransportConfigCallback}.
*
* @param <C>
* @param <T>
@ -75,7 +76,9 @@ public abstract class TransportCommand<C extends GitCommand, T> extends
protected TransportConfigCallback transportConfigCallback;
/**
* @param repo
* <p>Constructor for TransportCommand.</p>
*
* @param repo a {@link org.eclipse.jgit.lib.Repository} object.
*/
protected TransportCommand(final Repository repo) {
super(repo);
@ -83,8 +86,11 @@ protected TransportCommand(final Repository repo) {
}
/**
* Set the <code>credentialsProvider</code>.
*
* @param credentialsProvider
* the {@link CredentialsProvider} to use
* the {@link org.eclipse.jgit.transport.CredentialsProvider} to
* use
* @return {@code this}
*/
public C setCredentialsProvider(
@ -94,6 +100,8 @@ public C setCredentialsProvider(
}
/**
* Set <code>timeout</code>.
*
* @param timeout
* the timeout (in seconds) used for the transport step
* @return {@code this}
@ -104,12 +112,15 @@ public C setTimeout(int timeout) {
}
/**
* Set the <code>TransportConfigCallback</code>.
*
* @param transportConfigCallback
* if set, the callback will be invoked after the
* {@link Transport} has created, but before the
* {@link Transport} is used. The callback can use this
* opportunity to set additional type-specific configuration on
* the {@link Transport} instance.
* {@link org.eclipse.jgit.transport.Transport} has created, but
* before the {@link org.eclipse.jgit.transport.Transport} is
* used. The callback can use this opportunity to set additional
* type-specific configuration on the
* {@link org.eclipse.jgit.transport.Transport} instance.
* @return {@code this}
*/
public C setTransportConfigCallback(
@ -119,6 +130,11 @@ public C setTransportConfigCallback(
}
/** @return {@code this} */
/**
* Return this command
*
* @return this command
*/
@SuppressWarnings("unchecked")
protected final C self() {
return (C) this;
@ -129,6 +145,7 @@ protected final C self() {
* callback
*
* @param transport
* a {@link org.eclipse.jgit.transport.Transport} object.
* @return {@code this}
*/
protected C configure(final Transport transport) {
@ -145,6 +162,7 @@ protected C configure(final Transport transport) {
* {@code this} command
*
* @param childCommand
* a {@link org.eclipse.jgit.api.TransportCommand} object.
* @return {@code this}
*/
protected C configure(final TransportCommand childCommand) {

View File

@ -64,7 +64,9 @@ public interface TransportConfigCallback {
/**
* Add any additional transport-specific configuration required.
*
* @param transport
* a {@link org.eclipse.jgit.transport.Transport} object.
*/
public void configure(Transport transport);
}

View File

@ -67,6 +67,8 @@ public class AbortedByHookException extends GitAPIException {
private final int returnCode;
/**
* Constructor for AbortedByHookException
*
* @param message
* The error details.
* @param hookName
@ -83,6 +85,8 @@ public AbortedByHookException(String message, String hookName,
}
/**
* Get hook name
*
* @return the type of the hook that interrupted the git command.
*/
public String getHookName() {
@ -90,12 +94,15 @@ public String getHookName() {
}
/**
* Get return code
*
* @return the hook process result.
*/
public int getReturnCode() {
return returnCode;
}
/** {@inheritDoc} */
@Override
public String getMessage() {
return MessageFormat.format(JGitText.get().commandRejectedByHook,

View File

@ -45,7 +45,9 @@ public class CanceledException extends GitAPIException {
private static final long serialVersionUID = 1L;
/**
* @param message
* <p>Constructor for CanceledException.</p>
*
* @param message a {@link java.lang.String} object.
*/
public CanceledException(String message) {
super(message);

View File

@ -44,8 +44,10 @@ public class CannotDeleteCurrentBranchException extends GitAPIException {
private static final long serialVersionUID = 1L;
/**
* Constructor for CannotDeleteCurrentBranchException
*
* @param message
* the message
* error message
*/
public CannotDeleteCurrentBranchException(String message) {
super(message);

View File

@ -53,7 +53,6 @@ public class CheckoutConflictException extends GitAPIException {
*
* @param conflictingPaths
* list of conflicting paths
*
* @param e
* a {@link org.eclipse.jgit.errors.CheckoutConflictException}
* exception
@ -82,7 +81,11 @@ public CheckoutConflictException(List<String> conflictingPaths,
this.conflictingPaths = conflictingPaths;
}
/** @return all the paths where unresolved conflicts have been detected */
/**
* Get conflicting paths
*
* @return all the paths where unresolved conflicts have been detected
*/
public List<String> getConflictingPaths() {
return conflictingPaths;
}

View File

@ -55,10 +55,16 @@ public class ConcurrentRefUpdateException extends GitAPIException {
private Ref ref;
/**
* Constructor for ConcurrentRefUpdateException.
*
* @param message
* error message
* @param ref
* a {@link org.eclipse.jgit.lib.Ref}
* @param rc
* a {@link org.eclipse.jgit.lib.RefUpdate.Result}
* @param cause
* a {@link java.lang.Throwable}
*/
public ConcurrentRefUpdateException(String message, Ref ref,
RefUpdate.Result rc, Throwable cause) {
@ -69,9 +75,14 @@ public ConcurrentRefUpdateException(String message, Ref ref,
}
/**
* Constructor for ConcurrentRefUpdateException.
*
* @param message
* error message
* @param ref
* a {@link org.eclipse.jgit.lib.Ref}
* @param rc
* a {@link org.eclipse.jgit.lib.RefUpdate.Result}
*/
public ConcurrentRefUpdateException(String message, Ref ref,
RefUpdate.Result rc) {
@ -82,15 +93,21 @@ public ConcurrentRefUpdateException(String message, Ref ref,
}
/**
* @return the {@link Ref} which was tried to by updated
* Get <code>Ref</code>
*
* @return the {@link org.eclipse.jgit.lib.Ref} which was tried to by
* updated
*/
public Ref getRef() {
return ref;
}
/**
* @return the result which was returned by {@link RefUpdate#update()} and
* which caused this error
* Get result
*
* @return the result which was returned by
* {@link org.eclipse.jgit.lib.RefUpdate#update()} and which caused
* this error
*/
public RefUpdate.Result getResult() {
return rc;

View File

@ -55,15 +55,22 @@ public DetachedHeadException() {
}
/**
* Constructor for DetachedHeadException.
*
* @param message
* error message
* @param cause
* a {@link java.lang.Throwable} object.
*/
public DetachedHeadException(String message, Throwable cause) {
super(message, cause);
}
/**
* Constructor for DetachedHeadException.
*
* @param message
* error message
*/
public DetachedHeadException(String message) {
super(message);

View File

@ -46,15 +46,22 @@ public class EmtpyCommitException extends GitAPIException {
private static final long serialVersionUID = 1L;
/**
* Constructor for EmtpyCommitException
*
* @param message
* error message
* @param cause
* a {@link java.lang.Throwable}
*/
public EmtpyCommitException(String message, Throwable cause) {
super(message, cause);
}
/**
* Constructor for EmtpyCommitException.
*
* @param message
* error message
*/
public EmtpyCommitException(String message) {
super(message);

View File

@ -106,6 +106,8 @@ public FilterFailedException(int rc, String filterCommand, String path,
}
/**
* Get filter command
*
* @return the filterCommand
*/
public String getFilterCommand() {
@ -113,6 +115,8 @@ public String getFilterCommand() {
}
/**
* Get path
*
* @return the path of the file processed by the filter command
*/
public String getPath() {
@ -120,6 +124,8 @@ public String getPath() {
}
/**
* Get output
*
* @return the output generated by the filter command. Might be truncated to
* limit memory consumption.
*/
@ -128,6 +134,8 @@ public byte[] getOutput() {
}
/**
* Get error
*
* @return the error output returned by the filter command
*/
public String getError() {
@ -135,6 +143,8 @@ public String getError() {
}
/**
* Get return code
*
* @return the return code returned by the filter command
*/
public int getReturnCode() {

View File

@ -40,7 +40,6 @@
/**
* Superclass of all exceptions thrown by the API classes in
* {@code org.eclipse.jgit.api}
*
*/
public abstract class GitAPIException extends Exception {
private static final long serialVersionUID = 1L;

View File

@ -45,15 +45,22 @@ public class InvalidConfigurationException extends GitAPIException {
private static final long serialVersionUID = 1L;
/**
* Constructor for InvalidConfigurationException
*
* @param message
* error message
* @param cause
* a {@link java.lang.Throwable}
*/
public InvalidConfigurationException(String message, Throwable cause) {
super(message, cause);
}
/**
* Constructor for InvalidConfigurationException.
*
* @param message
* error message
*/
public InvalidConfigurationException(String message) {
super(message);

View File

@ -47,7 +47,10 @@ public class InvalidMergeHeadsException extends GitAPIException {
private static final long serialVersionUID = 1L;
/**
* Constructor for InvalidMergeHeadsException.
*
* @param msg
* error message
*/
public InvalidMergeHeadsException(String msg) {
super(msg);

View File

@ -45,16 +45,24 @@
*/
public class InvalidRebaseStepException extends GitAPIException {
private static final long serialVersionUID = 1L;
/**
* Constructor for InvalidRebaseStepException.
*
* @param msg
* error message
*/
public InvalidRebaseStepException(String msg) {
super(msg);
}
/**
* Constructor for InvalidRebaseStepException.
*
* @param msg
* error message
* @param cause
* a {@link java.lang.Throwable}
*/
public InvalidRebaseStepException(String msg, Throwable cause) {
super(msg, cause);

View File

@ -44,15 +44,22 @@ public class InvalidRefNameException extends GitAPIException {
private static final long serialVersionUID = 1L;
/**
* Constructor for InvalidRefNameException
*
* @param msg
* error message
*/
public InvalidRefNameException(String msg) {
super(msg);
}
/**
* Constructor for InvalidRefNameException.
*
* @param msg
* error message
* @param cause
* a {@link java.lang.Throwable}
*/
public InvalidRefNameException(String msg, Throwable cause) {
super(msg, cause);

View File

@ -44,15 +44,22 @@ public class InvalidRemoteException extends GitAPIException {
private static final long serialVersionUID = 1L;
/**
* @param msg message describing the invalid remote.
* Constructor for InvalidRemoteException
*
* @param msg
* message describing the invalid remote.
*/
public InvalidRemoteException(String msg) {
super(msg);
}
/**
* @param msg message describing the invalid remote.
* @param cause why the remote is invalid.
* Constructor for InvalidRemoteException
*
* @param msg
* message describing the invalid remote.
* @param cause
* why the remote is invalid.
*/
public InvalidRemoteException(String msg, Throwable cause) {
super(msg, cause);

View File

@ -45,7 +45,10 @@ public class InvalidTagNameException extends GitAPIException {
private static final long serialVersionUID = 1L;
/**
* Constructor for InvalidTagNameException.
*
* @param msg
* error message
*/
public InvalidTagNameException(String msg) {
super(msg);

View File

@ -63,7 +63,9 @@ public class JGitInternalException extends RuntimeException {
* Construct an exception for low-level internal exceptions
*
* @param message
* error message
* @param cause
* a {@link java.lang.Throwable}
*/
public JGitInternalException(String message, Throwable cause) {
super(message, cause);
@ -73,6 +75,7 @@ public JGitInternalException(String message, Throwable cause) {
* Construct an exception for low-level internal exceptions
*
* @param message
* error message
*/
public JGitInternalException(String message) {
super(message);

View File

@ -49,15 +49,22 @@ public class MultipleParentsNotAllowedException extends GitAPIException {
private static final long serialVersionUID = 1L;
/**
* Constructor for MultipleParentsNotAllowedException.
*
* @param message
* error message
* @param cause
* a {@link java.lang.Throwable}
*/
public MultipleParentsNotAllowedException(String message, Throwable cause) {
super(message, cause);
}
/**
* Constructor for MultipleParentsNotAllowedException.
*
* @param message
* error message
*/
public MultipleParentsNotAllowedException(String message) {
super(message);

View File

@ -48,15 +48,22 @@ public class NoFilepatternException extends GitAPIException {
private static final long serialVersionUID = 1L;
/**
* Constructor for NoFilepatternException.
*
* @param message
* error message
* @param cause
* a {@link java.lang.Throwable}
*/
public NoFilepatternException(String message, Throwable cause) {
super(message, cause);
}
/**
* Constructor for NoFilepatternException.
*
* @param message
* error message
*/
public NoFilepatternException(String message) {
super(message);

View File

@ -45,15 +45,22 @@ public class NoHeadException extends GitAPIException {
private static final long serialVersionUID = 1L;
/**
* Constructor for NoHeadException
*
* @param message
* error message
* @param cause
* a {@link java.lang.Throwable}
*/
public NoHeadException(String message, Throwable cause) {
super(message, cause);
}
/**
* Constructor for NoHeadException
*
* @param message
* error message
*/
public NoHeadException(String message) {
super(message);

View File

@ -47,15 +47,22 @@ public class NoMessageException extends GitAPIException {
private static final long serialVersionUID = 1L;
/**
* Constructor for NoMessageException
*
* @param message
* error message
* @param cause
* a {@link java.lang.Throwable}
*/
public NoMessageException(String message, Throwable cause) {
super(message, cause);
}
/**
* Constructor for NoMessageException
*
* @param message
* error message
*/
public NoMessageException(String message) {
super(message);

View File

@ -46,21 +46,27 @@
* Exception thrown when applying a patch fails
*
* @since 2.0
*
*/
public class PatchApplyException extends GitAPIException {
private static final long serialVersionUID = 1L;
/**
* Constructor for PatchApplyException
*
* @param message
* error message
* @param cause
* a {@link java.lang.Throwable}
*/
public PatchApplyException(String message, Throwable cause) {
super(message, cause);
}
/**
* Constructor for PatchApplyException
*
* @param message
* error message
*/
public PatchApplyException(String message) {
super(message);

View File

@ -52,7 +52,6 @@
* Exception thrown when applying a patch fails due to an invalid format
*
* @since 2.0
*
*/
public class PatchFormatException extends GitAPIException {
private static final long serialVersionUID = 1L;
@ -60,7 +59,10 @@ public class PatchFormatException extends GitAPIException {
private List<FormatError> errors;
/**
* Constructor for PatchFormatException
*
* @param errors
* a {@link java.util.List} of {@link FormatError}s
*/
public PatchFormatException(List<FormatError> errors) {
super(MessageFormat.format(JGitText.get().patchFormatException, errors));
@ -68,6 +70,8 @@ public PatchFormatException(List<FormatError> errors) {
}
/**
* Get list of errors
*
* @return all the errors where unresolved conflicts have been detected
*/
public List<FormatError> getErrors() {

View File

@ -37,17 +37,18 @@
*/
package org.eclipse.jgit.api.errors;
import org.eclipse.jgit.lib.Ref;
/**
* Thrown when trying to create a {@link Ref} with the same name as an existing
* one
* Thrown when trying to create a {@link org.eclipse.jgit.lib.Ref} with the same
* name as an existing one
*/
public class RefAlreadyExistsException extends GitAPIException {
private static final long serialVersionUID = 1L;
/**
* Constructor for RefAlreadyExistsException
*
* @param message
* error message
*/
public RefAlreadyExistsException(String message) {
super(message);

View File

@ -46,7 +46,10 @@ public class RefNotAdvertisedException extends GitAPIException {
private static final long serialVersionUID = 1L;
/**
* Constructor for RefNotAdvertisedException
*
* @param message
* error message
*/
public RefNotAdvertisedException(String message) {
super(message);

View File

@ -44,8 +44,12 @@ public class RefNotFoundException extends GitAPIException {
private static final long serialVersionUID = 1L;
/**
* Constructor for RefNotFoundException
*
* @param message
* error message
* @param cause
* a {@link java.lang.Throwable}
* @since 4.1
*/
public RefNotFoundException(String message, Throwable cause) {
@ -53,7 +57,10 @@ public RefNotFoundException(String message, Throwable cause) {
}
/**
* Constructor for RefNotFoundException
*
* @param message
* error message
*/
public RefNotFoundException(String message) {
super(message);

View File

@ -8,8 +8,12 @@ public class StashApplyFailureException extends GitAPIException {
private static final long serialVersionUID = 1L;
/**
* Constructor for StashApplyFailureException
*
* @param message
* error message
* @param cause
* a {@link java.lang.Throwable}
* @since 4.1
*/
public StashApplyFailureException(String message, Throwable cause) {
@ -20,6 +24,7 @@ public StashApplyFailureException(String message, Throwable cause) {
* Create a StashApplyFailedException
*
* @param message
* error message
*/
public StashApplyFailureException(final String message) {
super(message);

View File

@ -47,6 +47,8 @@ public class TooLargeObjectInPackException extends TransportException {
private static final long serialVersionUID = 1L;
/**
* Constructor for TooLargeObjectInPackException
*
* @param msg
* message describing the transport failure.
*/
@ -55,6 +57,8 @@ public TooLargeObjectInPackException(String msg) {
}
/**
* Constructor for TooLargeObjectInPackException
*
* @param msg
* message describing the transport exception.
* @param cause

View File

@ -46,6 +46,8 @@ public class TooLargePackException extends TransportException {
private static final long serialVersionUID = 1L;
/**
* Constructor for TooLargePackException
*
* @param msg
* message describing the transport failure.
*/
@ -54,6 +56,8 @@ public TooLargePackException(String msg) {
}
/**
* Constructor for TooLargePackException
*
* @param msg
* message describing the transport exception.
* @param cause

View File

@ -44,6 +44,8 @@ public class TransportException extends GitAPIException {
private static final long serialVersionUID = 1L;
/**
* Constructor for TransportException
*
* @param msg
* message describing the transport failure.
*/
@ -52,6 +54,8 @@ public TransportException(String msg) {
}
/**
* Constructor for TransportException
*
* @param msg
* message describing the transport exception.
* @param cause

View File

@ -63,8 +63,12 @@ public UnmergedPathsException(Throwable cause) {
}
/**
* Constructor for UnmergedPathsException
*
* @param message
* the message
* @param cause
* a {@link java.lang.Throwable}
* @since 4.1
*/
public UnmergedPathsException(String message, Throwable cause) {

View File

@ -46,15 +46,22 @@ public class WrongRepositoryStateException extends GitAPIException {
private static final long serialVersionUID = 1L;
/**
* Constructor for WrongRepositoryStateException.
*
* @param message
* error message
* @param cause
* a {@link java.lang.Throwable}
*/
public WrongRepositoryStateException(String message, Throwable cause) {
super(message, cause);
}
/**
* Constructor for WrongRepositoryStateException.
*
* @param message
* error message
*/
public WrongRepositoryStateException(String message) {
super(message);