Fetch command. It has setters for all
supported options and arguments of this command and a call() method
to finally execute the command.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | FetchCommand.
Callback for status of fetch operation. |
| Modifier and Type | Field and Description |
|---|---|
| private FetchCommand. | |
| private boolean | |
| private Instant | |
| private Integer | |
| private boolean | |
| private String | |
| private boolean | |
| private ProgressMonitor | |
| private List | |
| private String | |
| private Boolean | |
| private List | |
| private SubmoduleConfig. | |
| private TagOpt | |
| private boolean | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public FetchCommand | Returns: thisthe ref or commit; must not be shallowExclude)nullDeepens or shortens the history of a shallow repository to exclude commits reachable from a specified remote branch or tag. |
| public FetchCommand | Returns: thisthe commit; must not be shallowExclude)nullCreates a shallow clone with a history, excluding commits reachable from a specified remote branch or tag. |
| private List | |
| public FetchResult | call()
Implements abstract org. Implements java. Computes a result, or throws an exception if unable to do so. |
| private void | |
| public ProgressMonitor | |
| private SubmoduleConfig. | |
| public List | |
| public String | |
| public int | |
| public boolean | Returns: whether to check received objects for validityWhether to check received objects for validity |
| public boolean | |
| public boolean | Returns: whether refs affected by the fetch are updated forcefullyWhether fetch --force option is enabled |
| public boolean | Returns: whether to remove refs which no longer exist in the sourceWhether to remove refs which no longer exist in the source |
| public boolean | |
| public FetchCommand | |
| public FetchCommand | Returns: thiswhether to check objects for validity checkFetchedObjects)If set to |
| public FetchCommand | Returns: thisthe depth depth)Limits fetching to the specified number of commits from the tip of each remote branch history. |
| public FetchCommand | Returns: thiswhether to do a dry run dryRun)Sets whether the fetch operation should be a dry run |
| public FetchCommand | Returns: this commandwhether to update refs affected by the fetch forcefully force)Set fetch --force option |
| public FetchCommand | Returns: thisthe initial branch to check out when cloning the repository.
Can be specified as ref name ( branch)refs/heads/master),
branch name (master) or tag name
(v1.2.3). The default is to use the branch
pointed to by the cloned repository's HEAD and can be
requested by passing null or HEAD.Set the initial branch |
| public FetchCommand | Returns: thisThe progress monitor associated with the fetch operation. |
| public FetchCommand | Returns: thiscorresponds to the
--recurse-submodules/--no-recurse-submodules options. If
recursenull use the value of the
submodule.name.fetchRecurseSubmodules option
configured per submodule. If not specified there, use the
value of the fetch.recurseSubmodules option configured
in git config. If not configured in either, "on-demand" is the
built-in default.Set the mode to be used for recursing into submodules. |
| public FetchCommand | Returns: thisString representation of specs)RefSpecsThe ref specs to be used in the fetch operation |
| public FetchCommand | Returns: thisone or multiple specs)org.sThe ref specs to be used in the fetch operation |
| public FetchCommand | Returns: thislist of specs)org.sThe ref specs to be used in the fetch operation |
| public FetchCommand | |
| public FetchCommand | Returns: thiswhether to remove deleted removeDeletedRefs)RefsIf set to |
| pack-priv void | |
| public FetchCommand | Returns: thisthe timestammp; must not be shallowSince)nullDeepens or shortens the history of a shallow repository to include all reachable commits after a specified time. |
| public FetchCommand | Returns: thisthe timestammp; must not be shallowSince)nullDeepens or shortens the history of a shallow repository to include all reachable commits after a specified time. |
| public FetchCommand | |
| public FetchCommand | Returns: thisthe thin-pack preference thinPack)Sets the thin-pack preference for fetch operation. |
| public FetchCommand | Returns: thiswhether to unshallow or not unshallow)If the source repository is complete, converts a shallow repository to a complete one, removing all the limitations imposed by shallow repositories. |
| callback | back to summary |
|---|---|
| private FetchCommand. | |
| checkFetchedObjects | back to summary |
|---|---|
| private boolean checkFetchedObjects | |
| deepenSince | back to summary |
|---|---|
| private Instant deepenSince | |
| depth | back to summary |
|---|---|
| private Integer depth | |
| dryRun | back to summary |
|---|---|
| private boolean dryRun | |
| initialBranch | back to summary |
|---|---|
| private String initialBranch | |
| isForceUpdate | back to summary |
|---|---|
| private boolean isForceUpdate | |
| monitor | back to summary |
|---|---|
| private ProgressMonitor monitor | |
| refSpecs | back to summary |
|---|---|
| private List<RefSpec> refSpecs | |
| remote | back to summary |
|---|---|
| private String remote | |
| removeDeletedRefs | back to summary |
|---|---|
| private Boolean removeDeletedRefs | |
| shallowExcludes | back to summary |
|---|---|
| private List<String> shallowExcludes | |
| submoduleRecurseMode | back to summary |
|---|---|
| private SubmoduleConfig. | |
| tagOption | back to summary |
|---|---|
| private TagOpt tagOption | |
| thin | back to summary |
|---|---|
| private boolean thin | |
| unshallow | back to summary |
|---|---|
| private boolean unshallow | |
| FetchCommand | back to summary |
|---|---|
| protected FetchCommand(Repository repo) Constructor for FetchCommand.
| |
| addShallowExclude | back to summary |
|---|---|
| public FetchCommand addShallowExclude(String shallowExclude) Deepens or shortens the history of a shallow repository to exclude commits reachable from a specified remote branch or tag.
| |
| addShallowExclude | back to summary |
|---|---|
| public FetchCommand addShallowExclude(ObjectId shallowExclude) Creates a shallow clone with a history, excluding commits reachable from a specified remote branch or tag.
| |
| applyOptions | back to summary |
|---|---|
| private List | |
| call | back to summary |
|---|---|
| public FetchResult call() throws GitAPIException, InvalidRemoteException, TransportException Implements abstract org. Implements java. Doc from org. Computes a result, or throws an exception if unable to do so. Execute the command
Execute the
| |
| fetchSubmodules | back to summary |
|---|---|
| private void fetchSubmodules(FetchResult results) throws TransportException, GitAPIException, InvalidConfigurationException | |
| getProgressMonitor | back to summary |
|---|---|
| public ProgressMonitor getProgressMonitor() Get progress monitor
| |
| getRecurseMode | back to summary |
|---|---|
| private SubmoduleConfig. | |
| getRefSpecs | back to summary |
|---|---|
| public List Get list of | |
| getRemote | back to summary |
|---|---|
| public String getRemote() Get the remote
| |
| getTimeout | back to summary |
|---|---|
| public int getTimeout() Get timeout
| |
| isCheckFetchedObjects | back to summary |
|---|---|
| public boolean isCheckFetchedObjects() Whether to check received objects for validity
| |
| isDryRun | back to summary |
|---|---|
| public boolean isDryRun() Whether to do a dry run
| |
| isForceUpdate | back to summary |
|---|---|
| public boolean isForceUpdate() Whether fetch --force option is enabled
| |
| isRemoveDeletedRefs | back to summary |
|---|---|
| public boolean isRemoveDeletedRefs() Whether to remove refs which no longer exist in the source
| |
| isThin | back to summary |
|---|---|
| public boolean isThin() Get thin-pack preference
| |
| setCallback | back to summary |
|---|---|
| public FetchCommand setCallback(FetchCommand. Register a progress callback.
| |
| setCheckFetchedObjects | back to summary |
|---|---|
| public FetchCommand setCheckFetchedObjects(boolean checkFetchedObjects) If set to
| |
| setDepth | back to summary |
|---|---|
| public FetchCommand setDepth(int depth) Limits fetching to the specified number of commits from the tip of each remote branch history.
| |
| setDryRun | back to summary |
|---|---|
| public FetchCommand setDryRun(boolean dryRun) Sets whether the fetch operation should be a dry run
| |
| setForceUpdate | back to summary |
|---|---|
| public FetchCommand setForceUpdate(boolean force) Set fetch --force option
| |
| setInitialBranch | back to summary |
|---|---|
| public FetchCommand setInitialBranch(String branch) Set the initial branch
| |
| setProgressMonitor | back to summary |
|---|---|
| public FetchCommand setProgressMonitor(ProgressMonitor monitor) The progress monitor associated with the fetch operation. By default,
this is set to
| |
| setRecurseSubmodules | back to summary |
|---|---|
| public FetchCommand setRecurseSubmodules(SubmoduleConfig. Set the mode to be used for recursing into submodules.
| |
| setRefSpecs | back to summary |
|---|---|
| public FetchCommand setRefSpecs(String... specs) The ref specs to be used in the fetch operation
| |
| setRefSpecs | back to summary |
|---|---|
| public FetchCommand setRefSpecs(RefSpec... specs) The ref specs to be used in the fetch operation
| |
| setRefSpecs | back to summary |
|---|---|
| public FetchCommand setRefSpecs(List<RefSpec> specs) The ref specs to be used in the fetch operation
| |
| setRemote | back to summary |
|---|---|
| public FetchCommand setRemote(String remote) The remote (uri or name) used for the fetch operation. If no remote is
set, the default value of
| |
| setRemoveDeletedRefs | back to summary |
|---|---|
| public FetchCommand setRemoveDeletedRefs(boolean removeDeletedRefs) If set to
| |
| setShallowExcludes | back to summary |
|---|---|
| pack-priv void setShallowExcludes(List<String> shallowExcludes) | |
| setShallowSince | back to summary |
|---|---|
| public FetchCommand setShallowSince(OffsetDateTime shallowSince) Deepens or shortens the history of a shallow repository to include all reachable commits after a specified time.
| |
| setShallowSince | back to summary |
|---|---|
| public FetchCommand setShallowSince(Instant shallowSince) Deepens or shortens the history of a shallow repository to include all reachable commits after a specified time.
| |
| setTagOpt | back to summary |
|---|---|
| public FetchCommand setTagOpt(TagOpt tagOpt) Sets the specification of annotated tag behavior during fetch
| |
| setThin | back to summary |
|---|---|
| public FetchCommand setThin(boolean thinPack) Sets the thin-pack preference for fetch operation. Default setting is Transport.DEFAULT_FETCH_THIN
| |
| setUnshallow | back to summary |
|---|---|
| public FetchCommand setUnshallow(boolean unshallow) If the source repository is complete, converts a shallow repository to a complete one, removing all the limitations imposed by shallow repositories. If the source repository is shallow, fetches as much as possible so that the current repository has the same history as the source repository.
| |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| fetchingSubmodule | back to summary |
|---|---|
| public void fetchingSubmodule(String name) Notify fetching a submodule.
| |