public class Checkout extends Object
| Constructor and Description |
|---|
Checkout(Repository repo)
Creates a new
Checkout for checking out from the given
repository. |
Checkout(Repository repo,
WorkingTreeOptions options)
Creates a new
Checkout for checking out from the given
repository. |
| Modifier and Type | Method and Description |
|---|---|
void |
checkout(DirCacheEntry entry,
DirCacheCheckout.CheckoutMetadata metadata,
ObjectReader reader,
String gitPath)
Checks out the file given by the
DirCacheEntry. |
void |
checkoutGitlink(DirCacheEntry entry,
String gitPath)
Checks out the gitlink given by the
DirCacheEntry. |
WorkingTreeOptions |
getWorkingTreeOptions()
Retrieves the
WorkingTreeOptions of the repository that are
used. |
void |
safeCreateParentDirectory(String gitPath,
File parentDir,
boolean makeSpace)
Ensure that the given parent directory exists, and cache the information
that gitPath refers to a file.
|
Checkout |
setRecursiveDeletion(boolean recursive)
Defines whether directories that are in the way of the file to be checked
out shall be deleted recursively.
|
public Checkout(@NonNull Repository repo)
Checkout for checking out from the given
repository.repo - the Repository to check out frompublic Checkout(@NonNull Repository repo, WorkingTreeOptions options)
Checkout for checking out from the given
repository.repo - the Repository to check out fromoptions - the WorkingTreeOptions to use; if null,
read from the repo config when this object is
createdpublic WorkingTreeOptions getWorkingTreeOptions()
WorkingTreeOptions of the repository that are
used.WorkingTreeOptionspublic Checkout setRecursiveDeletion(boolean recursive)
recursive - whether to delete such directories recursivelythispublic void safeCreateParentDirectory(String gitPath, File parentDir, boolean makeSpace) throws IOException
gitPath - of the file to be writtenparentDir - directory in which the file shall be placed, assumed to be the
parent of the gitPathmakeSpace - whether to delete a possibly existing file at
parentDirIOException - if the directory cannot be created, if necessarypublic void checkoutGitlink(DirCacheEntry entry, String gitPath) throws IOException
DirCacheEntry.entry - DirCacheEntry to check outgitPath - the git path of the entry, if known already; otherwise
null and it's read from the entry itselfIOException - if the gitlink cannot be checked outpublic void checkout(DirCacheEntry entry, DirCacheCheckout.CheckoutMetadata metadata, ObjectReader reader, String gitPath) throws IOException
DirCacheEntry.entry - DirCacheEntry to check outmetadata - DirCacheCheckout.CheckoutMetadata to use for CR/LF handling and
smudge filteringreader - ObjectReader to usegitPath - the git path of the entry, if known already; otherwise
null and it's read from the entry itselfIOException - if the file cannot be checked outCopyright © 2024 Eclipse JGit Project. All rights reserved.