| Modifier and Type | Class and Description |
|---|---|
| public static interface | CloneCommand.
Callback for status of clone operation. |
| private static enum |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private String | |
| private Collection | |
| private CloneCommand. | |
| private boolean | |
| private boolean | |
| private Integer | |
| private File | |
| private boolean | |
| private CloneCommand. | |
| private FS | |
| private File | |
| private boolean | |
| private boolean | |
| private ProgressMonitor | |
| private boolean | |
| private boolean | |
| private String | |
| private List | |
| private Instant | |
| private ShutdownHook. | |
| private TagOpt | |
| private String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public CloneCommand | Returns: thisthe ref or commit; must not be shallowExclude)nullCreates a shallow clone with a history, excluding commits reachable from a specified remote branch or tag. |
| public CloneCommand | 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 Git | call()
Implements abstract org. Implements java. Computes a result, or throws an exception if unable to do so. |
| private void | |
| private void | |
| private void | |
| private void | |
| private FetchResult | |
| private Ref | |
| pack-priv File | |
| private Repository | |
| private static boolean | |
| private RevCommit | |
| public CloneCommand | Returns: this instancewhether the cloned repository is bare or not bare)Set whether the cloned repository shall be bare |
| public CloneCommand | Returns: this instancethe 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 CloneCommand | Returns: thiscollection of branches to clone. Must be specified as full ref
names (e.g. branchesToClone)refs/heads/master or
refs/tags/v1.0.0).Set the branches or tags to clone. |
| public CloneCommand | |
| public CloneCommand | Returns: thistrue when all branches have to be fetched (indicates
wildcard in created fetch refspec), false otherwise.Set whether all branches have to be fetched. |
| public CloneCommand | Returns: thistrue to initialize and update submodules. Ignored when
cloneSubmodules)setBare(boolean) is set to true.Set whether to clone submodules |
| public CloneCommand | Returns: thisthe depth depth)Creates a shallow clone with a history truncated to the specified number of commits. |
| public CloneCommand | Returns: this instancethe directory to clone to, or directory)null if the directory
name should be taken from the source uriThe optional directory associated with the clone operation. |
| private void | |
| public CloneCommand | |
| public CloneCommand | |
| public CloneCommand | Returns: thiswhether to mirror all refs from the source repository mirror)Set up a mirror of the source repository. |
| public CloneCommand | Returns: thisif set to noCheckout)true no branch will be checked out
after the clone. This enhances performance of the clone
command when there is no need for a checked out branch.Set whether to skip checking out a branch |
| public CloneCommand | |
| public CloneCommand | Returns: thisThe progress monitor associated with the clone operation. |
| public CloneCommand | Returns: this instanceif true, use relative paths for GIT_DIR and GIT_WORK_TREE relativePaths)Set whether the cloned repository shall use relative paths for GIT_DIR and GIT_WORK_TREE |
| public CloneCommand | |
| public CloneCommand | Returns: thisthe timestammp; must not be shallowSince)nullCreates a shallow clone with a history after the specified time. |
| public CloneCommand | Returns: thisthe timestammp; must not be shallowSince)nullCreates a shallow clone with a history after the specified time. |
| public CloneCommand | Returns: thistag option to be used for the remote config tagOption)Set the tag option used for the remote configuration explicitly. |
| public CloneCommand | |
| private static void | |
| pack-priv void |
| bare | back to summary |
|---|---|
| private boolean bare | |
| branch | back to summary |
|---|---|
| private String branch | |
| branchesToClone | back to summary |
|---|---|
| private Collection<String> branchesToClone | |
| callback | back to summary |
|---|---|
| private CloneCommand. | |
| cloneAllBranches | back to summary |
|---|---|
| private boolean cloneAllBranches | |
| cloneSubmodules | back to summary |
|---|---|
| private boolean cloneSubmodules | |
| depth | back to summary |
|---|---|
| private Integer depth | |
| directory | back to summary |
|---|---|
| private File directory | |
| directoryExistsInitially | back to summary |
|---|---|
| private boolean directoryExistsInitially | |
| fetchType | back to summary |
|---|---|
| private CloneCommand. | |
| fs | back to summary |
|---|---|
| private FS fs | |
| gitDir | back to summary |
|---|---|
| private File gitDir | |
| gitDirExistsInitially | back to summary |
|---|---|
| private boolean gitDirExistsInitially | |
| mirror | back to summary |
|---|---|
| private boolean mirror | |
| monitor | back to summary |
|---|---|
| private ProgressMonitor monitor | |
| noCheckout | back to summary |
|---|---|
| private boolean noCheckout | |
| relativePaths | back to summary |
|---|---|
| private boolean relativePaths | |
| remote | back to summary |
|---|---|
| private String remote | |
| shallowExcludes | back to summary |
|---|---|
| private List<String> shallowExcludes | |
| shallowSince | back to summary |
|---|---|
| private Instant shallowSince | |
| shutdownListener | back to summary |
|---|---|
| private ShutdownHook. | |
| tagOption | back to summary |
|---|---|
| private TagOpt tagOption | |
| uri | back to summary |
|---|---|
| private String uri | |
| CloneCommand | back to summary |
|---|---|
| public CloneCommand() Create clone command with no repository set | |
| addMergeConfig | back to summary |
|---|---|
| private void addMergeConfig(Repository clonedRepo, Ref head) throws IOException | |
| addShallowExclude | back to summary |
|---|---|
| public CloneCommand addShallowExclude(String shallowExclude) Creates a shallow clone with a history, excluding commits reachable from a specified remote branch or tag.
| |
| addShallowExclude | back to summary |
|---|---|
| public CloneCommand addShallowExclude(ObjectId shallowExclude) Creates a shallow clone with a history, excluding commits reachable from a specified remote branch or tag.
| |
| calculateRefSpecs | back to summary |
|---|---|
| private List | |
| call | back to summary |
|---|---|
| public Git 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
Executes the
| |
| checkout | back to summary |
|---|---|
| private void checkout(Repository clonedRepo, FetchResult result) throws MissingObjectException, IncorrectObjectTypeException, IOException, GitAPIException | |
| cleanup | back to summary |
|---|---|
| private void cleanup() | |
| cloneSubmodules | back to summary |
|---|---|
| private void cloneSubmodules(Repository clonedRepo) throws IOException, GitAPIException | |
| deleteChildren | back to summary |
|---|---|
| private void deleteChildren(File file) throws IOException | |
| fetch | back to summary |
|---|---|
| private FetchResult fetch(Repository clonedRepo, URIish u) throws URISyntaxException, TransportException, IOException, GitAPIException | |
| findBranchToCheckout | back to summary |
|---|---|
| private Ref findBranchToCheckout(FetchResult result) | |
| getDirectory | back to summary |
|---|---|
| pack-priv File getDirectory() Get the git directory. This is primarily used for tests. | |
| init | back to summary |
|---|---|
| private Repository init() throws GitAPIException | |
| isNonEmptyDirectory | back to summary |
|---|---|
| private static boolean isNonEmptyDirectory(File dir) | |
| parseCommit | back to summary |
|---|---|
| private RevCommit parseCommit(Repository clonedRepo, Ref ref) throws MissingObjectException, IncorrectObjectTypeException, IOException | |
| setBare | back to summary |
|---|---|
| public CloneCommand setBare(boolean bare) throws IllegalStateException Set whether the cloned repository shall be bare
| |
| setBranch | back to summary |
|---|---|
| public CloneCommand setBranch(String branch) Set the initial branch
| |
| setBranchesToClone | back to summary |
|---|---|
| public CloneCommand setBranchesToClone(Collection<String> branchesToClone) Set the branches or tags to clone.
This is ignored if
| |
| setCallback | back to summary |
|---|---|
| public CloneCommand setCallback(CloneCommand. Register a progress callback.
| |
| setCloneAllBranches | back to summary |
|---|---|
| public CloneCommand setCloneAllBranches(boolean cloneAllBranches) Set whether all branches have to be fetched.
If
| |
| setCloneSubmodules | back to summary |
|---|---|
| public CloneCommand setCloneSubmodules(boolean cloneSubmodules) Set whether to clone submodules
| |
| setDepth | back to summary |
|---|---|
| public CloneCommand setDepth(int depth) Creates a shallow clone with a history truncated to the specified number of commits.
| |
| setDirectory | back to summary |
|---|---|
| public CloneCommand setDirectory(File directory) The optional directory associated with the clone operation. If the directory isn't set, a name associated with the source uri will be used.
| |
| setFetchType | back to summary |
|---|---|
| private void setFetchType() | |
| setFs | back to summary |
|---|---|
| public CloneCommand setFs(FS fs) Set the file system abstraction to be used for repositories created by this command.
| |
| setGitDir | back to summary |
|---|---|
| public CloneCommand setGitDir(File gitDir) Set the repository meta directory (.git)
| |
| setMirror | back to summary |
|---|---|
| public CloneCommand setMirror(boolean mirror) Set up a mirror of the source repository. This implies that a bare
repository will be created. Compared to
| |
| setNoCheckout | back to summary |
|---|---|
| public CloneCommand setNoCheckout(boolean noCheckout) Set whether to skip checking out a branch
| |
| setNoTags | back to summary |
|---|---|
| public CloneCommand setNoTags() Set the --no-tags option. Tags are not cloned now and the remote configuration is initialized with the --no-tags option as well.
| |
| setProgressMonitor | back to summary |
|---|---|
| public CloneCommand setProgressMonitor(ProgressMonitor monitor) The progress monitor associated with the clone operation. By default,
this is set to
| |
| setRelativePaths | back to summary |
|---|---|
| public CloneCommand setRelativePaths(boolean relativePaths) Set whether the cloned repository shall use relative paths for GIT_DIR and GIT_WORK_TREE
| |
| setRemote | back to summary |
|---|---|
| public CloneCommand setRemote(String remote) The remote name used to keep track of the upstream repository for the
clone operation. If no remote name is set, the default value of
| |
| setShallowSince | back to summary |
|---|---|
| public CloneCommand setShallowSince(OffsetDateTime shallowSince) Creates a shallow clone with a history after the specified time.
| |
| setShallowSince | back to summary |
|---|---|
| public CloneCommand setShallowSince(Instant shallowSince) Creates a shallow clone with a history after the specified time.
| |
| setTagOption | back to summary |
|---|---|
| public CloneCommand setTagOption(TagOpt tagOption) Set the tag option used for the remote configuration explicitly.
| |
| setURI | back to summary |
|---|---|
| public CloneCommand setURI(String uri) Set the URI to clone from
| |
| validateDirs | back to summary |
|---|---|
| private static void validateDirs(File directory, File gitDir, boolean bare) throws IllegalStateException | |
| verifyDirectories | back to summary |
|---|---|
| pack-priv void verifyDirectories(URIish u) | |
| Modifier and Type | Method and Description |
|---|---|
| public void | checkingOut(AnyObjectId
the id of the commit being checked out commit, String the submodule path path)Notify checkout of commit |
| public void | |
| public void |
| checkingOut | back to summary |
|---|---|
| public void checkingOut(AnyObjectId commit, String path) Notify checkout of commit
| |
| cloningSubmodule | back to summary |
|---|---|
| public void cloningSubmodule(String path) Notify starting to clone a submodule.
| |
| initializedSubmodules | back to summary |
|---|---|
| public void initializedSubmodules(Collection<String> submodules) Notify initialized submodules.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final CloneCommand. | |
| public static final CloneCommand. | |
| public static final CloneCommand. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static CloneCommand. | |
| public static CloneCommand. |
| ALL_BRANCHES | back to summary |
|---|---|
| public static final CloneCommand. | |
| MIRROR | back to summary |
|---|---|
| public static final CloneCommand. | |
| MULTIPLE_BRANCHES | back to summary |
|---|---|
| public static final CloneCommand. | |
| FETCH_TYPE | back to summary |
|---|---|
| private FETCH_TYPE() | |
| valueOf | back to summary |
|---|---|
| public static CloneCommand. | |
| values | back to summary |
|---|---|
| public static CloneCommand. | |