Browse Source

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

Change-Id: I2761ea91f8dfed16ea54e7a6646af03a30c15ec9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-4.10
Matthias Sohn 7 years ago
parent
commit
0210e0e299
  1. 1
      org.eclipse.jgit/src/org/eclipse/jgit/annotations/Nullable.java
  2. 24
      org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java
  3. 14
      org.eclipse.jgit/src/org/eclipse/jgit/api/AddNoteCommand.java
  4. 9
      org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java
  5. 6
      org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyResult.java
  6. 34
      org.eclipse.jgit/src/org/eclipse/jgit/api/ArchiveCommand.java
  7. 17
      org.eclipse.jgit/src/org/eclipse/jgit/api/BlameCommand.java
  8. 34
      org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java
  9. 24
      org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutResult.java
  10. 26
      org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java
  11. 28
      org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickResult.java
  12. 9
      org.eclipse.jgit/src/org/eclipse/jgit/api/CleanCommand.java
  13. 44
      org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java
  14. 55
      org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java
  15. 25
      org.eclipse.jgit/src/org/eclipse/jgit/api/CreateBranchCommand.java
  16. 15
      org.eclipse.jgit/src/org/eclipse/jgit/api/DeleteBranchCommand.java
  17. 9
      org.eclipse.jgit/src/org/eclipse/jgit/api/DeleteTagCommand.java
  18. 42
      org.eclipse.jgit/src/org/eclipse/jgit/api/DescribeCommand.java
  19. 21
      org.eclipse.jgit/src/org/eclipse/jgit/api/DiffCommand.java
  20. 50
      org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java
  21. 13
      org.eclipse.jgit/src/org/eclipse/jgit/api/GarbageCollectCommand.java
  22. 445
      org.eclipse.jgit/src/org/eclipse/jgit/api/Git.java
  23. 42
      org.eclipse.jgit/src/org/eclipse/jgit/api/GitCommand.java
  24. 14
      org.eclipse.jgit/src/org/eclipse/jgit/api/InitCommand.java
  25. 6
      org.eclipse.jgit/src/org/eclipse/jgit/api/ListBranchCommand.java
  26. 17
      org.eclipse.jgit/src/org/eclipse/jgit/api/ListNotesCommand.java
  27. 7
      org.eclipse.jgit/src/org/eclipse/jgit/api/ListTagCommand.java
  28. 62
      org.eclipse.jgit/src/org/eclipse/jgit/api/LogCommand.java
  29. 23
      org.eclipse.jgit/src/org/eclipse/jgit/api/LsRemoteCommand.java
  30. 36
      org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java
  31. 51
      org.eclipse.jgit/src/org/eclipse/jgit/api/MergeResult.java
  32. 24
      org.eclipse.jgit/src/org/eclipse/jgit/api/NameRevCommand.java
  33. 54
      org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java
  34. 13
      org.eclipse.jgit/src/org/eclipse/jgit/api/PullResult.java
  35. 71
      org.eclipse.jgit/src/org/eclipse/jgit/api/PushCommand.java
  36. 57
      org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java
  37. 32
      org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseResult.java
  38. 9
      org.eclipse.jgit/src/org/eclipse/jgit/api/ReflogCommand.java
  39. 8
      org.eclipse.jgit/src/org/eclipse/jgit/api/RemoteAddCommand.java
  40. 10
      org.eclipse.jgit/src/org/eclipse/jgit/api/RemoteListCommand.java
  41. 10
      org.eclipse.jgit/src/org/eclipse/jgit/api/RemoteRemoveCommand.java
  42. 10
      org.eclipse.jgit/src/org/eclipse/jgit/api/RemoteSetUrlCommand.java
  43. 17
      org.eclipse.jgit/src/org/eclipse/jgit/api/RemoveNoteCommand.java
  44. 23
      org.eclipse.jgit/src/org/eclipse/jgit/api/RenameBranchCommand.java
  45. 20
      org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java
  46. 50
      org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java
  47. 15
      org.eclipse.jgit/src/org/eclipse/jgit/api/RmCommand.java
  48. 13
      org.eclipse.jgit/src/org/eclipse/jgit/api/ShowNoteCommand.java
  49. 22
      org.eclipse.jgit/src/org/eclipse/jgit/api/StashApplyCommand.java
  50. 18
      org.eclipse.jgit/src/org/eclipse/jgit/api/StashCreateCommand.java
  51. 16
      org.eclipse.jgit/src/org/eclipse/jgit/api/StashDropCommand.java
  52. 3
      org.eclipse.jgit/src/org/eclipse/jgit/api/StashListCommand.java
  53. 42
      org.eclipse.jgit/src/org/eclipse/jgit/api/Status.java
  54. 28
      org.eclipse.jgit/src/org/eclipse/jgit/api/StatusCommand.java
  55. 16
      org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleAddCommand.java
  56. 8
      org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleInitCommand.java
  57. 8
      org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleStatusCommand.java
  58. 11
      org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleSyncCommand.java
  59. 22
      org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleUpdateCommand.java
  60. 36
      org.eclipse.jgit/src/org/eclipse/jgit/api/TagCommand.java
  61. 36
      org.eclipse.jgit/src/org/eclipse/jgit/api/TransportCommand.java
  62. 2
      org.eclipse.jgit/src/org/eclipse/jgit/api/TransportConfigCallback.java
  63. 7
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/AbortedByHookException.java
  64. 4
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/CanceledException.java
  65. 4
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/CannotDeleteCurrentBranchException.java
  66. 7
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/CheckoutConflictException.java
  67. 23
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/ConcurrentRefUpdateException.java
  68. 7
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/DetachedHeadException.java
  69. 7
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/EmtpyCommitException.java
  70. 10
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/FilterFailedException.java
  71. 1
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/GitAPIException.java
  72. 7
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/InvalidConfigurationException.java
  73. 3
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/InvalidMergeHeadsException.java
  74. 8
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/InvalidRebaseStepException.java
  75. 7
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/InvalidRefNameException.java
  76. 13
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/InvalidRemoteException.java
  77. 3
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/InvalidTagNameException.java
  78. 3
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/JGitInternalException.java
  79. 7
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/MultipleParentsNotAllowedException.java
  80. 7
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/NoFilepatternException.java
  81. 7
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/NoHeadException.java
  82. 7
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/NoMessageException.java
  83. 8
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/PatchApplyException.java
  84. 6
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/PatchFormatException.java
  85. 9
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/RefAlreadyExistsException.java
  86. 3
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/RefNotAdvertisedException.java
  87. 7
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/RefNotFoundException.java
  88. 5
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/StashApplyFailureException.java
  89. 4
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/TooLargeObjectInPackException.java
  90. 4
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/TooLargePackException.java
  91. 4
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/TransportException.java
  92. 4
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/UnmergedPathsException.java
  93. 7
      org.eclipse.jgit/src/org/eclipse/jgit/api/errors/WrongRepositoryStateException.java

1
org.eclipse.jgit/src/org/eclipse/jgit/annotations/Nullable.java

@ -89,7 +89,6 @@ import java.lang.annotation.Target;
* @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

24
org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java

@ -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 class AddCommand extends GitCommand<DirCache> {
/**
* 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 class AddCommand extends GitCommand<DirCache> {
}
/**
* {@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 class AddCommand extends GitCommand<DirCache> {
}
/**
* 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 class AddCommand extends GitCommand<DirCache> {
}
/**
* @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;

14
org.eclipse.jgit/src/org/eclipse/jgit/api/AddNoteCommand.java

@ -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 class AddNoteCommand extends GitCommand<Note> {
* 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 class AddNoteCommand extends GitCommand<Note> {
}
/**
* Set the notes message
*
* @param message
* the notes message used when adding a note
* @return {@code this}
@ -152,12 +159,13 @@ public class AddNoteCommand extends GitCommand<Note> {
}
/**
* 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) {

9
org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java

@ -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 class ApplyCommand extends GitCommand<ApplyResult> {
}
/**
* {@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,

6
org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyResult.java

@ -47,7 +47,7 @@ import java.util.ArrayList;
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 class ApplyResult {
}
/**
* Get updated files
*
* @return updated files
*/
public List<File> getUpdatedFiles() {

34
org.eclipse.jgit/src/org/eclipse/jgit/api/ArchiveCommand.java

@ -70,19 +70,16 @@ import org.eclipse.jgit.treewalk.filter.PathFilterGroup;
/**
* 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 @@ import org.eclipse.jgit.treewalk.filter.PathFilterGroup;
*
* @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 @@ public class ArchiveCommand extends GitCommand<OutputStream> {
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 @@ public class ArchiveCommand extends GitCommand<OutputStream> {
}
}
/**
* @return the stream to which the archive has been written
*/
/** {@inheritDoc} */
@Override
public OutputStream call() throws GitAPIException {
checkCallable();
@ -456,6 +453,8 @@ public class ArchiveCommand extends GitCommand<OutputStream> {
}
/**
* 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 class ArchiveCommand extends GitCommand<OutputStream> {
}
/**
* 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 class ArchiveCommand extends GitCommand<OutputStream> {
}
/**
* 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 class ArchiveCommand extends GitCommand<OutputStream> {
}
/**
* 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 class ArchiveCommand extends GitCommand<OutputStream> {
}
/**
* Set archive format options
*
* @param options
* archive format options (e.g., level=9 for zip compression).
* @return this

17
org.eclipse.jgit/src/org/eclipse/jgit/api/BlameCommand.java

@ -69,7 +69,8 @@ import org.eclipse.jgit.util.IO;
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 class BlameCommand extends GitCommand<BlameResult> {
* 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 class BlameCommand extends GitCommand<BlameResult> {
* 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 class BlameCommand extends GitCommand<BlameResult> {
* Set start commit id
*
* @param commit
* id of a commit
* @return this command
*/
public BlameCommand setStartCommit(AnyObjectId commit) {
@ -164,7 +171,7 @@ public class BlameCommand extends GitCommand<BlameResult> {
* 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 class BlameCommand extends GitCommand<BlameResult> {
* 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 class BlameCommand extends GitCommand<BlameResult> {
}
/**
* {@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 {

34
org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java

@ -91,7 +91,7 @@ import org.eclipse.jgit.treewalk.filter.PathFilterGroup;
/**
* 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 @@ import org.eclipse.jgit.treewalk.filter.PathFilterGroup;
* .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 @@ public class CheckoutCommand extends GitCommand<Ref> {
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 class CheckoutCommand extends GitCommand<Ref> {
/**
* 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 class CheckoutCommand extends GitCommand<Ref> {
}
/**
* <p>getResult.</p>
*
* @return the result, never <code>null</code>
*/
public CheckoutResult getResult() {

24
org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutResult.java

@ -46,8 +46,7 @@ import java.util.ArrayList;
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 class CheckoutResult {
}
/**
* Get status
*
* @return the status
*/
public Status getStatus() {
@ -175,33 +176,44 @@ public class CheckoutResult {
}
/**
* 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;

26
org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java

@ -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 @@ public class CherryPickCommand extends GitCommand<CherryPickResult> {
}
/**
* 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 class CherryPickCommand extends GitCommand<CherryPickResult> {
}
/**
* 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 class CherryPickCommand extends GitCommand<CherryPickResult> {
}
/**
* Include a commit
*
* @param name
* a name given to the commit
* @param commit
@ -257,6 +260,8 @@ public class CherryPickCommand extends GitCommand<CherryPickResult> {
}
/**
* 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 class CherryPickCommand extends GitCommand<CherryPickResult> {
}
/**
* Set the {@code MergeStrategy}
*
* @param strategy
* The merge strategy to use during this Cherry-pick.
* @return {@code this}
@ -295,6 +302,8 @@ public class CherryPickCommand extends GitCommand<CherryPickResult> {
}
/**
* 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 @@ public class CherryPickCommand extends GitCommand<CherryPickResult> {
return headName;
}
/** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {

28
org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickResult.java

@ -46,12 +46,11 @@ import java.util.List;
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 class CherryPickResult {
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 class CherryPickResult {
}
/**
* 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 @@ public class CherryPickResult {
CherryPickStatus.CONFLICTING);
/**
* Get status
*
* @return the status this cherry-pick resulted in
*/
public CherryPickStatus getStatus() {
@ -137,28 +143,34 @@ public class CherryPickResult {
}
/**
* 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;

9
org.eclipse.jgit/src/org/eclipse/jgit/api/CleanCommand.java

@ -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 {

44
org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java

@ -167,6 +167,8 @@ public class CloneCommand extends TransportCommand<CloneCommand, Git> {
}
/**
* {@inheritDoc}
* <p>
* Executes the {@code Clone} command.
*
* The Git instance returned by this command needs to be closed by the
@ -174,11 +176,6 @@ public class CloneCommand extends TransportCommand<CloneCommand, Git> {
* 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 @@ public class CloneCommand extends TransportCommand<CloneCommand, Git> {
}
/**
* 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 class CloneCommand extends TransportCommand<CloneCommand, Git> {
* 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 class CloneCommand extends TransportCommand<CloneCommand, Git> {
}
/**
* 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 class CloneCommand extends TransportCommand<CloneCommand, Git> {
}
/**
* 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 class CloneCommand extends TransportCommand<CloneCommand, Git> {
}
/**
* 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 class CloneCommand extends TransportCommand<CloneCommand, Git> {
* 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 class CloneCommand extends TransportCommand<CloneCommand, Git> {
}
/**
* 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 class CloneCommand extends TransportCommand<CloneCommand, Git> {
}
/**
* 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 class CloneCommand extends TransportCommand<CloneCommand, Git> {
}
/**
* 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 class CloneCommand extends TransportCommand<CloneCommand, Git> {
}
/**
* 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

55
org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java

@ -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 @@ public class CommitCommand extends GitCommand<RevCommit> {
}
/**
* Set the commit message
*
* @param message
* the commit message used for the {@code commit}
* @return {@code this}
@ -613,6 +604,8 @@ public class CommitCommand extends GitCommand<RevCommit> {
}
/**
* 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 class CommitCommand extends GitCommand<RevCommit> {
* <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 class CommitCommand extends GitCommand<RevCommit> {
}
/**
* Get the commit message
*
* @return the commit message used for the <code>commit</code>
*/
public String getMessage() {
@ -673,10 +669,12 @@ public class CommitCommand extends GitCommand<RevCommit> {
}
/**
* 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 class CommitCommand extends GitCommand<RevCommit> {
}
/**
* 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 class CommitCommand extends GitCommand<RevCommit> {
* 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 class CommitCommand extends GitCommand<RevCommit> {
}
/**
* 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 class CommitCommand extends GitCommand<RevCommit> {
* will be replaced by the change id.
*
* @param insertChangeId
*
* whether to insert a change id
* @return {@code this}
*/
public CommitCommand setInsertChangeId(boolean insertChangeId) {

25
org.eclipse.jgit/src/org/eclipse/jgit/api/CreateBranchCommand.java

@ -103,23 +103,16 @@ public class CreateBranchCommand extends GitCommand<Ref> {
}
/**
* 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 @@ public class CreateBranchCommand extends GitCommand<Ref> {
}
/**
* Set the name of the new branch
*
* @param name
* the name of the new branch
* @return this instance
@ -308,6 +303,8 @@ public class CreateBranchCommand extends GitCommand<Ref> {
}
/**
* 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 class CreateBranchCommand extends GitCommand<Ref> {
}
/**
* 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 class CreateBranchCommand extends GitCommand<Ref> {
}
/**
* 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 class CreateBranchCommand extends GitCommand<Ref> {
}
/**
* Set the upstream mode
*
* @param mode
* corresponds to the --track/--no-track/--set-upstream options;
* may be <code>null</code>

15
org.eclipse.jgit/src/org/eclipse/jgit/api/DeleteBranchCommand.java

@ -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 class DeleteBranchCommand extends GitCommand<List<String>> {
}
/**
* 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 class DeleteBranchCommand extends GitCommand<List<String>> {
}
/**
* 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>

9
org.eclipse.jgit/src/org/eclipse/jgit/api/DeleteTagCommand.java

@ -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 class DeleteTagCommand extends GitCommand<List<String>> {
}
/**
* 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

42
org.eclipse.jgit/src/org/eclipse/jgit/api/DescribeCommand.java

@ -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 @@ public class DescribeCommand extends GitCommand<String> {
* 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 class DescribeCommand extends GitCommand<String> {
* 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 class DescribeCommand extends GitCommand<String> {
* @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 @@ public class DescribeCommand extends GitCommand<String> {
}
/**
* 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 @@ public class DescribeCommand extends GitCommand<String> {
}
/**
* {@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 {

21
org.eclipse.jgit/src/org/eclipse/jgit/api/DiffCommand.java

@ -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 class DiffCommand extends GitCommand<List<DiffEntry>> {
}
/**
* 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 class DiffCommand extends GitCommand<List<DiffEntry>> {
}
/**
* Set path filter
*
* @param pathFilter
* parameter, used to limit the diff to the named path
* @return this instance
@ -183,6 +189,8 @@ public class DiffCommand extends GitCommand<List<DiffEntry>> {
}
/**
* Set old tree
*
* @param oldTree
* the previous state
* @return this instance
@ -193,6 +201,8 @@ public class DiffCommand extends GitCommand<List<DiffEntry>> {
}
/**
* Set new tree
*
* @param newTree
* the updated state
* @return this instance
@ -203,6 +213,8 @@ public class DiffCommand extends GitCommand<List<DiffEntry>> {
}
/**
* 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 class DiffCommand extends GitCommand<List<DiffEntry>> {
}
/**
* Set output stream
*
* @param out
* the stream to write line data
* @return this instance
@ -263,7 +277,6 @@ public class DiffCommand extends GitCommand<List<DiffEntry>> {
* is set to <code>NullProgressMonitor</code>
*
* @see NullProgressMonitor
*
* @param monitor
* a progress monitor
* @return this instance

50
org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java

@ -122,7 +122,10 @@ public class FetchCommand extends TransportCommand<FetchCommand, FetchResult> {
}
/**
* Constructor for FetchCommand.
*
* @param repo
* a {@link org.eclipse.jgit.lib.Repository} object.
*/
protected FetchCommand(Repository repo) {
super(repo);
@ -210,17 +213,12 @@ public class FetchCommand extends TransportCommand<FetchCommand, FetchResult> {
}
/**
* 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 class FetchCommand extends TransportCommand<FetchCommand, FetchResult> {
*
* @see Constants#DEFAULT_REMOTE_NAME
* @param remote
* name of a remote
* @return {@code this}
*/
public FetchCommand setRemote(String remote) {
@ -297,6 +296,8 @@ public class FetchCommand extends TransportCommand<FetchCommand, FetchResult> {
}
/**
* Get the remote
*
* @return the remote used for the remote operation
*/
public String getRemote() {
@ -304,6 +305,8 @@ public class FetchCommand extends TransportCommand<FetchCommand, FetchResult> {
}
/**
* Get timeout
*
* @return the timeout used for the fetch operation
*/
public int getTimeout() {
@ -311,16 +314,19 @@ public class FetchCommand extends TransportCommand<FetchCommand, FetchResult> {
}
/**
* @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 class FetchCommand extends TransportCommand<FetchCommand, FetchResult> {
}
/**
* @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 class FetchCommand extends TransportCommand<FetchCommand, FetchResult> {
}
/**
* 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 class FetchCommand extends TransportCommand<FetchCommand, FetchResult> {
}
/**
* Get progress monitor
*
* @return the progress monitor for the fetch operation
*/
public ProgressMonitor getProgressMonitor() {
@ -370,8 +382,8 @@ public class FetchCommand extends TransportCommand<FetchCommand, FetchResult> {
* 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 class FetchCommand extends TransportCommand<FetchCommand, FetchResult> {
}
/**
* Get list of {@code RefSpec}s
*
* @return the ref specs
*/
public List<RefSpec> getRefSpecs() {
@ -394,6 +408,7 @@ public class FetchCommand extends TransportCommand<FetchCommand, FetchResult> {
* 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 class FetchCommand extends TransportCommand<FetchCommand, FetchResult> {
* 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 class FetchCommand extends TransportCommand<FetchCommand, FetchResult> {
* 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 class FetchCommand extends TransportCommand<FetchCommand, FetchResult> {
}
/**
* Whether to do a dry run
*
* @return the dry run preference for the fetch operation
*/
public boolean isDryRun() {
@ -436,6 +455,7 @@ public class FetchCommand extends TransportCommand<FetchCommand, FetchResult> {
* 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 class FetchCommand extends TransportCommand<FetchCommand, FetchResult> {
}
/**
* Get thin-pack preference
*
* @return the thin-pack preference for fetch operation
*/
public boolean isThin() {
@ -457,6 +479,7 @@ public class FetchCommand extends TransportCommand<FetchCommand, FetchResult> {
* 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 class FetchCommand extends TransportCommand<FetchCommand, FetchResult> {
* 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) {

13
org.eclipse.jgit/src/org/eclipse/jgit/api/GarbageCollectCommand.java

@ -61,7 +61,6 @@ import org.eclipse.jgit.lib.ProgressMonitor;
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 @@ public class GarbageCollectCommand extends GitCommand<Properties> {
}
/**
* Set progress monitor
*
* @param monitor
* a progress monitor
* @return this instance
@ -118,8 +122,8 @@ public class GarbageCollectCommand extends GitCommand<Properties> {
* 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 class GarbageCollectCommand extends GitCommand<Properties> {
return this;
}
/** {@inheritDoc} */
@Override
public Properties call() throws GitAPIException {
checkCallable();
@ -229,7 +234,7 @@ public class GarbageCollectCommand extends GitCommand<Properties> {
* 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
*/

445
org.eclipse.jgit/src/org/eclipse/jgit/api/Git.java

@ -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 class Git implements AutoCloseable {
}
/**
* 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>
* Free resources associated with this instance.
* <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.)
* 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>
* 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 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.
* In all cases, after calling this method you should not use this
* {@link Git} instance anymore.
*
* @since 3.2
*/
@ -154,23 +164,23 @@ public class Git implements AutoCloseable {
}
/**
* 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 class Git implements AutoCloseable {
}
/**
* 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 class Git implements AutoCloseable {
}
/**
* 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 class Git implements AutoCloseable {
/**
*
* 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 class Git implements AutoCloseable {
}
/**
* 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 class Git implements AutoCloseable {
}
/**
* 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 class Git implements AutoCloseable {
}
/**
* 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 class Git implements AutoCloseable {
}
/**
* 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 class Git implements AutoCloseable {
}
/**
* Returns 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 command object to execute a {@code gc} command
*
* @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 class Git implements AutoCloseable {
}
/**
* 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 class Git implements AutoCloseable {
}
/**
* 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 class Git implements AutoCloseable {
/**
* 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 class Git implements AutoCloseable {
/**
* 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 class Git implements AutoCloseable {
/**
* 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 class Git implements AutoCloseable {
/**
* 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 class Git implements AutoCloseable {
}
/**
* 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 class Git implements AutoCloseable {
return repo;
}
/** {@inheritDoc} */
@Override
public String toString() {
return "Git[" + repo + "]"; //$NON-NLS-1$//$NON-NLS-2$

42
org.eclipse.jgit/src/org/eclipse/jgit/api/GitCommand.java

@ -48,18 +48,20 @@ import org.eclipse.jgit.lib.Repository;
/**
* 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 @@ public abstract class GitCommand<T> implements Callable<T> {
/**
* 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 @@ public abstract class GitCommand<T> implements Callable<T> {
}
/**
* 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;

14
org.eclipse.jgit/src/org/eclipse/jgit/api/InitCommand.java

@ -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 class InitCommand implements Callable<Git> {
* @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 class InitCommand implements Callable<Git> {
}
/**
* 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 @@ public class InitCommand implements Callable<Git> {
}
/**
* 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

6
org.eclipse.jgit/src/org/eclipse/jgit/api/ListBranchCommand.java

@ -95,12 +95,16 @@ public class ListBranchCommand extends GitCommand<List<Ref>> {
}
/**
* 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 @@ public class ListBranchCommand extends GitCommand<List<Ref>> {
}
/**
* Set the list mode
*
* @param listMode
* optional: corresponds to the -r/-a options; by default, only
* local branches will be listed

17
org.eclipse.jgit/src/org/eclipse/jgit/api/ListNotesCommand.java

@ -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 class ListNotesCommand extends GitCommand<List<Note>> {
}
/**
* 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
* 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) {

7
org.eclipse.jgit/src/org/eclipse/jgit/api/ListTagCommand.java

@ -65,15 +65,16 @@ import org.eclipse.jgit.revwalk.RevWalk;
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();

62
org.eclipse.jgit/src/org/eclipse/jgit/api/LogCommand.java

@ -78,7 +78,7 @@ import org.eclipse.jgit.treewalk.filter.TreeFilter;
* 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 @@ public class LogCommand extends GitCommand<Iterable<RevCommit>> {
}
/**
* {@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 @@ public class LogCommand extends GitCommand<Iterable<RevCommit>> {
*
* @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 class LogCommand extends GitCommand<Iterable<RevCommit>> {
* 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 class LogCommand extends GitCommand<Iterable<RevCommit>> {
* 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 class LogCommand extends GitCommand<Iterable<RevCommit>> {
*
* @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 @@ public class LogCommand extends GitCommand<Iterable<RevCommit>> {
/**
* 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>

23
org.eclipse.jgit/src/org/eclipse/jgit/api/LsRemoteCommand.java

@ -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 class LsRemoteCommand extends
*
* @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 class LsRemoteCommand extends
* 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 class LsRemoteCommand extends
* 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 class LsRemoteCommand extends
* 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 class LsRemoteCommand extends
}
/**
* 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 class LsRemoteCommand extends
* 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

36
org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java

@ -211,19 +211,22 @@ public class MergeCommand extends GitCommand<MergeResult> {
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 @@ public class MergeCommand extends GitCommand<MergeResult> {
}
/**
* 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 class MergeCommand extends GitCommand<MergeResult> {
}
/**
* 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 class MergeCommand extends GitCommand<MergeResult> {
}
/**
* 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 class MergeCommand extends GitCommand<MergeResult> {
}
/**
* 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 class MergeCommand extends GitCommand<MergeResult> {
* 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 class MergeCommand extends GitCommand<MergeResult> {
* <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 class MergeCommand extends GitCommand<MergeResult> {
* is set to <code>NullProgressMonitor</code>
*
* @see NullProgressMonitor
*
* @param monitor
* A progress monitor
* @return this instance

51
org.eclipse.jgit/src/org/eclipse/jgit/api/MergeResult.java

@ -53,11 +53,10 @@ import org.eclipse.jgit.lib.ObjectId;
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 class MergeResult {
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 class MergeResult {
* @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 class MergeResult {
}
/**
* Constructor for MergeResult.
*
* @param newHead
* the object the head points at after the merge
* @param base
@ -286,9 +289,10 @@ public class MergeResult {
* @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 class MergeResult {
}
/**
* Constructor for MergeResult.
*
* @param newHead
* the object the head points at after the merge
* @param base
@ -313,13 +319,13 @@ public class MergeResult {
* @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 class MergeResult {
}
/**
* 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 class MergeResult {
}
/**
* Get the merge status
*
* @return the status the merge resulted in
*/
public MergeStatus getMergeStatus() {
@ -368,6 +378,8 @@ public class MergeResult {
}
/**
* Get the commits which have been merged
*
* @return all the commits which have been merged together
*/
public ObjectId[] getMergedCommits() {
@ -375,6 +387,8 @@ public class MergeResult {
}
/**
* 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 class MergeResult {
return base;
}
/** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {
@ -402,6 +417,8 @@ public class MergeResult {
}
/**
* Set conflicts
*
* @param conflicts
* the conflicts to set
*/
@ -410,7 +427,10 @@ public class MergeResult {
}
/**
* 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 class MergeResult {
}
/**
* 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 class MergeResult {
/**
* 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 class MergeResult {
/**
* 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

24
org.eclipse.jgit/src/org/eclipse/jgit/api/NameRevCommand.java

@ -57,7 +57,6 @@ import org.eclipse.jgit.lib.AnyObjectId;
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 class NameRevCommand extends GitCommand<Map<ObjectId, String>> {
* 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 class NameRevCommand extends GitCommand<Map<ObjectId, String>> {
};
}
/** {@inheritDoc} */
@Override
public Map<ObjectId, String> call() throws GitAPIException {
try {
@ -199,13 +200,13 @@ public class NameRevCommand extends GitCommand<Map<ObjectId, String>> {
* @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 class NameRevCommand extends GitCommand<Map<ObjectId, String>> {
* @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 class NameRevCommand extends GitCommand<Map<ObjectId, String>> {
* 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 class NameRevCommand extends GitCommand<Map<ObjectId, String>> {
}
/**
* 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 class NameRevCommand extends GitCommand<Map<ObjectId, String>> {
* @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();

54
org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java

@ -52,7 +52,6 @@ import org.eclipse.jgit.api.MergeCommand.FastForwardMode;
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 class PullCommand extends TransportCommand<PullCommand, PullResult> {
* 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 class PullCommand extends TransportCommand<PullCommand, PullResult> {
}
/**
* 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 class PullCommand extends TransportCommand<PullCommand, PullResult> {
* {@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 class PullCommand extends TransportCommand<PullCommand, PullResult> {
}
/**
* 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 class PullCommand extends TransportCommand<PullCommand, PullResult> {
*
* @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 class PullCommand extends TransportCommand<PullCommand, PullResult> {
* 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 class PullCommand extends TransportCommand<PullCommand, PullResult> {
}
/**
* 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 class PullCommand extends TransportCommand<PullCommand, PullResult> {
}
/**
* 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 class PullCommand extends TransportCommand<PullCommand, PullResult> {
}
/**
* Set the @{code MergeStrategy}
*
* @param strategy
* The merge strategy to use during this pull operation.
* @return {@code this}
@ -424,9 +429,10 @@ public class PullCommand extends TransportCommand<PullCommand, PullResult> {
}
/**
* 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 class PullCommand extends TransportCommand<PullCommand, PullResult> {
}
/**
* 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 class PullCommand extends TransportCommand<PullCommand, PullResult> {
* 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 class PullCommand extends TransportCommand<PullCommand, PullResult> {
* 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,

13
org.eclipse.jgit/src/org/eclipse/jgit/api/PullResult.java

@ -45,7 +45,7 @@ package org.eclipse.jgit.api;
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 class PullResult {
}
/**
* Get merge result
*
* @return the merge result, or <code>null</code>
*/
public MergeResult getMergeResult() {
@ -87,6 +91,8 @@ public class PullResult {
}
/**
* Get rebase result
*
* @return the rebase result, or <code>null</code>
*/
public RebaseResult getRebaseResult() {
@ -94,6 +100,8 @@ public class PullResult {
}
/**
* 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 class PullResult {
}
/**
* Whether the pull was successful
*
* @return whether the pull was successful
*/
public boolean isSuccessful() {
@ -112,6 +122,7 @@ public class PullResult {
return true;
}
/** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {

71
org.eclipse.jgit/src/org/eclipse/jgit/api/PushCommand.java

@ -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 @@ public class PushCommand extends
}
/**
* 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 class PushCommand extends
*
* @see Constants#DEFAULT_REMOTE_NAME
* @param remote
* the remote name
* @return {@code this}
*/
public PushCommand setRemote(String remote) {
@ -218,6 +219,8 @@ public class PushCommand extends
}
/**
* Get remote name
*
* @return the remote used for the remote operation
*/
public String getRemote() {
@ -231,6 +234,8 @@ public class PushCommand extends
*
* @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 class PushCommand extends
}
/**
* 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 class PushCommand extends
}
/**
* Get timeout used for push operation
*
* @return the timeout used for the push operation
*/
public int getTimeout() {
@ -254,6 +263,8 @@ public class PushCommand extends
}
/**
* Get the progress monitor
*
* @return the progress monitor for the push operation
*/
public ProgressMonitor getProgressMonitor() {
@ -265,8 +276,8 @@ public class PushCommand extends
* 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 class PushCommand extends
}
/**
* @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 class PushCommand extends
}
/**
* 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 class PushCommand extends
}
/**
* 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 class PushCommand extends
}
/**
* Get <code>RefSpec</code>s.
* </p>
*
* @return the ref specs
*/
public List<RefSpec> getRefSpecs() {
@ -325,7 +343,7 @@ public class PushCommand extends
/**
* 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 class PushCommand extends
* 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 class PushCommand extends
}
/**
* 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 class PushCommand extends
/**
* 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 class PushCommand extends
}
/**
* Get the thin-pack preference
*
* @return the thin-pack preference for push operation
*/
public boolean isThin() {
@ -434,11 +457,12 @@ public class PushCommand extends
}
/**
* 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 class PushCommand extends
}
/**
* 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 class PushCommand extends
* Default setting is false.
*
* @param atomic
* whether to run the push atomically
* @return {@code this}
* @since 4.2
*/
@ -471,6 +499,8 @@ public class PushCommand extends
}
/**
* Whether to push forcefully
*
* @return the force preference for push operation
*/
public boolean isForce() {
@ -481,6 +511,7 @@ public class PushCommand extends
* 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 class PushCommand extends
* 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 class PushCommand extends
}
/**
* Get push options
*
* @return the option strings associated with the push operation
* @since 4.5
*/
@ -510,9 +544,10 @@ public class PushCommand extends
}
/**
* 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
*/

57
org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java

@ -238,7 +238,12 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
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 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
}
/**
* {@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 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
}
/**
* 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 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
/**
* Set upstream {@code RevCommit}
*
* @param upstream
* the upstream commit
* @return {@code this}
@ -1447,6 +1452,8 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
}
/**
* Set the upstream commit
*
* @param upstream
* id of the upstream commit
* @return {@code this}
@ -1464,10 +1471,12 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
}
/**
* 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 class RebaseCommand extends GitCommand<RebaseResult> {
}
/**
* Set the operation to execute during rebase
*
* @param operation
* the operation to perform
* @return {@code this}
@ -1512,6 +1523,8 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
}
/**
* Set progress monitor
*
* @param monitor
* a progress monitor
* @return this instance
@ -1525,15 +1538,18 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
}
/**
* 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 class RebaseCommand extends GitCommand<RebaseResult> {
}
/**
* 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 class RebaseCommand extends GitCommand<RebaseResult> {
}
/**
* Set the <code>MergeStrategy</code>.
*
* @param strategy
* The merge strategy to use during this rebase operation.
* @return {@code this}
@ -1573,9 +1594,11 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
}
/**
* 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
*/

32
org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseResult.java

@ -45,12 +45,11 @@ package org.eclipse.jgit.api;
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 @@ public class RebaseResult {
}
/**
* Get the status
*
* @return the overall status
*/
public Status getStatus() {
@ -286,33 +287,46 @@ public class RebaseResult {
}
/**
* @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() {

9
org.eclipse.jgit/src/org/eclipse/jgit/api/ReflogCommand.java

@ -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 class ReflogCommand extends GitCommand<Collection<ReflogEntry>> {
* 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 class ReflogCommand extends GitCommand<Collection<ReflogEntry>> {
}
/**
* {@inheritDoc}
* <p>
* Run the reflog command
*
* @throws GitAPIException
* @throws InvalidRefNameException
*/
@Override
public Collection<ReflogEntry> call() throws GitAPIException,

8
org.eclipse.jgit/src/org/eclipse/jgit/api/RemoteAddCommand.java

@ -63,7 +63,6 @@ import org.eclipse.jgit.transport.URIish;
* @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 class RemoteAddCommand extends GitCommand<RemoteConfig> {
}
/**
* {@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 {

10
org.eclipse.jgit/src/org/eclipse/jgit/api/RemoteListCommand.java

@ -59,23 +59,27 @@ import org.eclipse.jgit.transport.RemoteConfig;
* @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 {

10
org.eclipse.jgit/src/org/eclipse/jgit/api/RemoteRemoveCommand.java

@ -61,7 +61,6 @@ import org.eclipse.jgit.transport.RemoteConfig;
* @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 class RemoteRemoveCommand extends GitCommand<RemoteConfig> {
}
/**
* {@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 {

10
org.eclipse.jgit/src/org/eclipse/jgit/api/RemoteSetUrlCommand.java

@ -62,7 +62,6 @@ import org.eclipse.jgit.transport.URIish;
* @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 class RemoteSetUrlCommand extends GitCommand<RemoteConfig> {
}
/**
* {@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 {

17
org.eclipse.jgit/src/org/eclipse/jgit/api/RemoveNoteCommand.java

@ -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 class RemoveNoteCommand extends GitCommand<Note> {
* 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 @@ public class RemoveNoteCommand extends GitCommand<Note> {
}
/**
* Set the name of the <code>Ref</code> to remove a note 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
* 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) {

23
org.eclipse.jgit/src/org/eclipse/jgit/api/RenameBranchCommand.java

@ -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 class RenameBranchCommand extends GitCommand<Ref> {
}
/**
* Set the new name of the branch
*
* @param newName
* the new name
* @return this instance
@ -209,6 +204,8 @@ public class RenameBranchCommand extends GitCommand<Ref> {
}
/**
* 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

20
org.eclipse.jgit/src/org/eclipse/jgit/api/ResetCommand.java

@ -126,20 +126,23 @@ public class ResetCommand extends GitCommand<Ref> {
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 @@ public class ResetCommand extends GitCommand<Ref> {
}
/**
* 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 class ResetCommand extends GitCommand<Ref> {
}
/**
* Set the reset mode
*
* @param mode
* the mode of the reset command
* @return this instance
@ -282,6 +289,8 @@ public class ResetCommand extends GitCommand<Ref> {
}
/**
* 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 class ResetCommand extends GitCommand<Ref> {
}
/**
* Whether to disable reflog
*
* @param disable
* if {@code true} disables writing a reflog entry for this reset
* command
@ -309,6 +320,8 @@ public class ResetCommand extends GitCommand<Ref> {
}
/**
* Whether reflog is disabled
*
* @return {@code true} if writing reflog is disabled for this reset command
* @since 4.5
*/
@ -433,6 +446,7 @@ public class ResetCommand extends GitCommand<Ref> {
repo.writeMergeCommitMsg(null);
}
/** {@inheritDoc} */
@SuppressWarnings("nls")
@Override
public String toString() {

50
org.eclipse.jgit/src/org/eclipse/jgit/api/RevertCommand.java

@ -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 class RevertCommand extends GitCommand<RevCommit> {
}
/**
* 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 class RevertCommand extends GitCommand<RevCommit> {
}
/**
* 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 class RevertCommand extends GitCommand<RevCommit> {
}
/**
* 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 class RevertCommand extends GitCommand<RevCommit> {
}
/**
* 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 @@ public class RevertCommand extends GitCommand<RevCommit> {
}
/**
* @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 class RevertCommand extends GitCommand<RevCommit> {
}
/**
* Get unmerged paths
*
* @return the unmerged paths, will be null if no merge conflicts
*/
public List<String> getUnmergedPaths() {
@ -304,8 +314,10 @@ public class RevertCommand extends GitCommand<RevCommit> {
}
/**
* 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
*/

15
org.eclipse.jgit/src/org/eclipse/jgit/api/RmCommand.java

@ -72,7 +72,7 @@ import org.eclipse.jgit.treewalk.filter.PathFilterGroup;
* 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 class RmCommand extends GitCommand<DirCache> {
}
/**
* 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 class RmCommand extends GitCommand<DirCache> {
* 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 class RmCommand extends GitCommand<DirCache> {
}
/**
* {@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,

13
org.eclipse.jgit/src/org/eclipse/jgit/api/ShowNoteCommand.java

@ -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 class ShowNoteCommand extends GitCommand<Note> {
* 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 class ShowNoteCommand extends GitCommand<Note> {
}
/**
* 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) {

22
org.eclipse.jgit/src/org/eclipse/jgit/api/StashApplyCommand.java

@ -88,7 +88,6 @@ import org.eclipse.jgit.treewalk.TreeWalk;
*
* @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 class StashApplyCommand extends GitCommand<ObjectId> {
* 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 class StashApplyCommand extends GitCommand<ObjectId> {
}
/**
* 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 @@ public class StashApplyCommand extends GitCommand<ObjectId> {
}
/**
* {@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 class StashApplyCommand extends GitCommand<ObjectId> {
}
/**
* Whether to restore the index state
*
* @param applyIndex
* true (default) if the command should restore the index state
*/
@ -281,6 +283,8 @@ public class StashApplyCommand extends GitCommand<ObjectId> {
}
/**
* 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 class StashApplyCommand extends GitCommand<ObjectId> {
}
/**
* Whether the command should restore untracked files
*
* @param applyUntracked
* true (default) if the command should restore untracked files
* @since 3.4

18
org.eclipse.jgit/src/org/eclipse/jgit/api/StashCreateCommand.java

@ -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 class StashCreateCommand extends GitCommand<RevCommit> {
* 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 class StashCreateCommand extends GitCommand<RevCommit> {
* 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 class StashCreateCommand extends GitCommand<RevCommit> {
* 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 class StashCreateCommand extends GitCommand<RevCommit> {
}
/**
* 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 class StashCreateCommand extends GitCommand<RevCommit> {
* 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 @@ public class StashCreateCommand extends GitCommand<RevCommit> {
}
/**
* {@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 {

16
org.eclipse.jgit/src/org/eclipse/jgit/api/StashDropCommand.java

@ -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 class StashDropCommand extends GitCommand<ObjectId> {
* 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 class StashDropCommand extends GitCommand<ObjectId> {
}
/**
* 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 @@ public class StashDropCommand extends GitCommand<ObjectId> {
}
/**
* {@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 {

3
org.eclipse.jgit/src/org/eclipse/jgit/api/StashListCommand.java

@ -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 {

42
org.eclipse.jgit/src/org/eclipse/jgit/api/Status.java

@ -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 class Status {
}
/**
* @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 class Status {
}
/**
* 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 class Status {
}
/**
* 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 class Status {
}
/**
* 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 class Status {
}
/**
* 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 class Status {
}
/**
* 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 class Status {
}
/**
* 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 class Status {
}
/**
* 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 class Status {
}
/**
* @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 class Status {
}
/**
* 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 class Status {
}
/**
* 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() {

28
org.eclipse.jgit/src/org/eclipse/jgit/api/StatusCommand.java

@ -64,9 +64,9 @@ import org.eclipse.jgit.treewalk.filter.PathFilterGroup;
* 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 class StatusCommand extends GitCommand<Status> {
}
/**
* {@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 class StatusCommand extends GitCommand<Status> {
}
/**
* 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 class StatusCommand extends GitCommand<Status> {
}
/**
* 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
*/

16
org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleAddCommand.java

@ -69,8 +69,8 @@ import org.eclipse.jgit.treewalk.filter.TreeFilter;
* .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 class SubmoduleAddCommand extends
* 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 class SubmoduleAddCommand extends
*
* @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 class SubmoduleAddCommand extends
* 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 @@ public class SubmoduleAddCommand extends
}
/**
* {@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 {

8
org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleInitCommand.java

@ -63,8 +63,8 @@ import org.eclipse.jgit.treewalk.filter.PathFilterGroup;
* .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 class SubmoduleInitCommand extends GitCommand<Collection<String>> {
return this;
}
/** {@inheritDoc} */
@Override
public Collection<String> call() throws GitAPIException {
checkCallable();

8
org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleStatusCommand.java

@ -62,8 +62,8 @@ import org.eclipse.jgit.treewalk.filter.PathFilterGroup;
/**
* 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 class SubmoduleStatusCommand extends
return this;
}
/** {@inheritDoc} */
@Override
public Map<String, SubmoduleStatus> call() throws GitAPIException {
checkCallable();

11
org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleSyncCommand.java

@ -65,8 +65,8 @@ import org.eclipse.jgit.treewalk.filter.PathFilterGroup;
* 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 class SubmoduleSyncCommand extends GitCommand<Map<String, String>> {
* 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 @@ public class SubmoduleSyncCommand extends GitCommand<Map<String, String>> {
return null;
}
/** {@inheritDoc} */
@Override
public Map<String, String> call() throws GitAPIException {
checkCallable();

22
org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleUpdateCommand.java

@ -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 class SubmoduleUpdateCommand extends
*
* @see NullProgressMonitor
* @param monitor
* a {@link org.eclipse.jgit.lib.ProgressMonitor} object.
* @return this command
*/
public SubmoduleUpdateCommand setProgressMonitor(
@ -122,6 +128,7 @@ public class SubmoduleUpdateCommand extends
* 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 class SubmoduleUpdateCommand extends
}
/**
* 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 class SubmoduleUpdateCommand extends
}
/**
* Setter for the field <code>strategy</code>.
*
* @param strategy
* The merge strategy to use during this update operation.
* @return {@code this}

36
org.eclipse.jgit/src/org/eclipse/jgit/api/TagCommand.java

@ -68,7 +68,7 @@ import org.eclipse.jgit.revwalk.RevWalk;
/**
* 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 @@ public class TagCommand extends GitCommand<Ref> {
}
/**
* Set the tag <code>name</code>.
*
* @param name
* the tag name used for the {@code tag}
* @return {@code this}
@ -237,6 +240,8 @@ public class TagCommand extends GitCommand<Ref> {
}
/**
* Get the tag <code>name</code>.
*
* @return the tag name used for the <code>tag</code>
*/
public String getName() {
@ -244,6 +249,8 @@ public class TagCommand extends GitCommand<Ref> {
}
/**
* Get the tag <code>message</code>.
*
* @return the tag message used for the <code>tag</code>
*/
public String getMessage() {
@ -251,6 +258,8 @@ public class TagCommand extends GitCommand<Ref> {
}
/**
* Set the tag <code>message</code>.
*
* @param message
* the tag message used for the {@code tag}
* @return {@code this}
@ -262,6 +271,8 @@ public class TagCommand extends GitCommand<Ref> {
}
/**
* Whether this tag is signed
*
* @return whether the tag is signed
*/
public boolean isSigned() {
@ -273,6 +284,7 @@ public class TagCommand extends GitCommand<Ref> {
* 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 class TagCommand extends GitCommand<Ref> {
* 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 class TagCommand extends GitCommand<Ref> {
}
/**
* Get the <code>tagger</code> who created the tag.
*
* @return the tagger of the tag
*/
public PersonIdent getTagger() {
@ -300,6 +315,8 @@ public class TagCommand extends GitCommand<Ref> {
}
/**
* Get the tag's object id
*
* @return the object id of the tag
*/
public RevObject getObjectId() {
@ -311,6 +328,7 @@ public class TagCommand extends GitCommand<Ref> {
* 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 class TagCommand extends GitCommand<Ref> {
}
/**
* Whether this is a forced update
*
* @return is this a force update
*/
public boolean isForceUpdate() {
@ -330,6 +350,7 @@ public class TagCommand extends GitCommand<Ref> {
* 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 class TagCommand extends GitCommand<Ref> {
}
/**
* 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 class TagCommand extends GitCommand<Ref> {
}
/**
* Whether this will create an annotated command
*
* @return true if this command will create an annotated tag (default is
* true)
* @since 3.0

36
org.eclipse.jgit/src/org/eclipse/jgit/api/TransportCommand.java

@ -47,11 +47,12 @@ import org.eclipse.jgit.transport.CredentialsProvider;
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 @@ public abstract class TransportCommand<C extends GitCommand, T> extends
}
/**
* 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 abstract class TransportCommand<C extends GitCommand, T> extends
}
/**
* Set <code>timeout</code>.
*
* @param timeout
* the timeout (in seconds) used for the transport step
* @return {@code this}
@ -104,12 +112,15 @@ public abstract class TransportCommand<C extends GitCommand, T> extends
}
/**
* 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 abstract class TransportCommand<C extends GitCommand, T> extends
}
/** @return {@code this} */
/**
* Return this command
*
* @return this command
*/
@SuppressWarnings("unchecked")
protected final C self() {
return (C) this;
@ -129,6 +145,7 @@ public abstract class TransportCommand<C extends GitCommand, T> extends
* callback
*
* @param transport
* a {@link org.eclipse.jgit.transport.Transport} object.
* @return {@code this}
*/
protected C configure(final Transport transport) {
@ -145,6 +162,7 @@ public abstract class TransportCommand<C extends GitCommand, T> extends
* {@code this} command
*
* @param childCommand
* a {@link org.eclipse.jgit.api.TransportCommand} object.
* @return {@code this}
*/
protected C configure(final TransportCommand childCommand) {

2
org.eclipse.jgit/src/org/eclipse/jgit/api/TransportConfigCallback.java

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

7
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/AbortedByHookException.java

@ -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 class AbortedByHookException extends GitAPIException {
}
/**
* Get hook name
*
* @return the type of the hook that interrupted the git command.
*/
public String getHookName() {
@ -90,12 +94,15 @@ public class AbortedByHookException extends GitAPIException {
}
/**
* Get return code
*
* @return the hook process result.
*/
public int getReturnCode() {
return returnCode;
}
/** {@inheritDoc} */
@Override
public String getMessage() {
return MessageFormat.format(JGitText.get().commandRejectedByHook,

4
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/CanceledException.java

@ -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);

4
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/CannotDeleteCurrentBranchException.java

@ -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);

7
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/CheckoutConflictException.java

@ -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 class CheckoutConflictException extends GitAPIException {
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;
}

23
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/ConcurrentRefUpdateException.java

@ -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 class ConcurrentRefUpdateException extends GitAPIException {
}
/**
* 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 class ConcurrentRefUpdateException extends GitAPIException {
}
/**
* @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;

7
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/DetachedHeadException.java

@ -55,15 +55,22 @@ public class DetachedHeadException extends GitAPIException {
}
/**
* 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);

7
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/EmtpyCommitException.java

@ -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);

10
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/FilterFailedException.java

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

1
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/GitAPIException.java

@ -40,7 +40,6 @@ package org.eclipse.jgit.api.errors;
/**
* 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;

7
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/InvalidConfigurationException.java

@ -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);

3
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/InvalidMergeHeadsException.java

@ -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);

8
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/InvalidRebaseStepException.java

@ -45,16 +45,24 @@ package org.eclipse.jgit.api.errors;
*/
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);

7
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/InvalidRefNameException.java

@ -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);

13
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/InvalidRemoteException.java

@ -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);

3
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/InvalidTagNameException.java

@ -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);

3
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/JGitInternalException.java

@ -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 class JGitInternalException extends RuntimeException {
* Construct an exception for low-level internal exceptions
*
* @param message
* error message
*/
public JGitInternalException(String message) {
super(message);

7
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/MultipleParentsNotAllowedException.java

@ -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);

7
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/NoFilepatternException.java

@ -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);

7
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/NoHeadException.java

@ -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);

7
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/NoMessageException.java

@ -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);

8
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/PatchApplyException.java

@ -46,21 +46,27 @@ package org.eclipse.jgit.api.errors;
* 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);

6
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/PatchFormatException.java

@ -52,7 +52,6 @@ import org.eclipse.jgit.patch.FormatError;
* 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 class PatchFormatException extends GitAPIException {
}
/**
* Get list of errors
*
* @return all the errors where unresolved conflicts have been detected
*/
public List<FormatError> getErrors() {

9
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/RefAlreadyExistsException.java

@ -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);

3
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/RefNotAdvertisedException.java

@ -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);

7
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/RefNotFoundException.java

@ -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 class RefNotFoundException extends GitAPIException {
}
/**
* Constructor for RefNotFoundException
*
* @param message
* error message
*/
public RefNotFoundException(String message) {
super(message);

5
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/StashApplyFailureException.java

@ -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 class StashApplyFailureException extends GitAPIException {
* Create a StashApplyFailedException
*
* @param message
* error message
*/
public StashApplyFailureException(final String message) {
super(message);

4
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/TooLargeObjectInPackException.java

@ -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 class TooLargeObjectInPackException extends TransportException {
}
/**
* Constructor for TooLargeObjectInPackException
*
* @param msg
* message describing the transport exception.
* @param cause

4
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/TooLargePackException.java

@ -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 class TooLargePackException extends TransportException {
}
/**
* Constructor for TooLargePackException
*
* @param msg
* message describing the transport exception.
* @param cause

4
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/TransportException.java

@ -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 class TransportException extends GitAPIException {
}
/**
* Constructor for TransportException
*
* @param msg
* message describing the transport exception.
* @param cause

4
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/UnmergedPathsException.java

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

7
org.eclipse.jgit/src/org/eclipse/jgit/api/errors/WrongRepositoryStateException.java

@ -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);

Loading…
Cancel
Save