Add command. It has setters for all
supported options and arguments of this command and a call() method
to finally execute the command. Each instance of this class should only be
used for one invocation of the command (means: one call to call())
| Modifier and Type | Field and Description |
|---|---|
| private Boolean | |
| private List | |
| private boolean | |
| private boolean | |
| private WorkingTreeIterator |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public AddCommand | Returns: thisrepository-relative path of file/directory to add (with
filepattern)/ as separator)Add a path to a file/directory whose content should be added. |
| public DirCache | call()
Implements abstract org. Implements java. Computes a result, or throws an exception if unable to do so. |
| public boolean | Returns: true if it was set; false otherwiseTells whether '--all' has been set for this command. |
| public boolean | Returns: whether files will be renormalizedTells whether the command will renormalize by re-applying the "clean" process to tracked files. |
| public boolean | Returns: whether to only match against already tracked filesWhether to only match against already tracked files |
| public AddCommand | Returns: thiswhether to enable '--all' mode all)Defines whether the command will use '--all' mode: update existing index entries, add new entries, and remove index entries for which there is no file. |
| public AddCommand | Returns: thiswhether to renormalize tracked files renormalize)Defines whether the command will renormalize by re-applying the "clean" process to tracked files. |
| public AddCommand | Returns: thisIf set to true, the command only matches update)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 filepattern must
exist also if update is set to true as there is no concept of
a working directory here.Set whether to only match against already tracked files. |
| public AddCommand | Returns: thisAllow clients to provide their own implementation of a FileTreeIterator |
| all | back to summary |
|---|---|
| private Boolean all | |
| filepatterns | back to summary |
|---|---|
| private List<String> filepatterns | |
| renormalize | back to summary |
|---|---|
| private boolean renormalize | |
| update | back to summary |
|---|---|
| private boolean update | |
| workingTreeIterator | back to summary |
|---|---|
| private WorkingTreeIterator workingTreeIterator | |
| AddCommand | back to summary |
|---|---|
| public AddCommand(Repository repo) Constructor for AddCommand
| |
| addFilepattern | back to summary |
|---|---|
| public AddCommand addFilepattern(String filepattern) Add a path to a file/directory whose content should be added.
A directory name (e.g.
If a pattern
File patterns are required unless
| |
| call | back to summary |
|---|---|
| public DirCache call() throws GitAPIException, NoFilepatternException 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
| |
| isAll | back to summary |
|---|---|
| public boolean isAll() Tells whether '--all' has been set for this command.
| |
| isRenormalize | back to summary |
|---|---|
| public boolean isRenormalize() Tells whether the command will renormalize by re-applying the "clean" process to tracked files.
For legacy reasons, this is
This setting is independent of
| |
| isUpdate | back to summary |
|---|---|
| public boolean isUpdate() Whether to only match against already tracked files
| |
| setAll | back to summary |
|---|---|
| public AddCommand setAll(boolean all) Defines whether the command will use '--all' mode: update existing index entries, add new entries, and remove index entries for which there is no file. (In other words: also stage deletions.)
The setting is independent of
| |
| setRenormalize | back to summary |
|---|---|
| public AddCommand setRenormalize(boolean renormalize) Defines whether the command will renormalize by re-applying the "clean" process to tracked files.
This does not automatically call
| |
| setUpdate | back to summary |
|---|---|
| public AddCommand setUpdate(boolean update) Set whether to only match against already tracked files. If
| |
| setWorkingTreeIterator | back to summary |
|---|---|
| public AddCommand setWorkingTreeIterator(WorkingTreeIterator f) Allow clients to provide their own implementation of a FileTreeIterator
| |