- All Implemented Interfaces:
public class AddCommand
- extends GitCommand<DirCache>
A class used to execute a
Add command. It has setters for all
supported options and arguments of this command and a
to finally execute the command. Each instance of this class should only be
used for one invocation of the command (means: one call to
- See Also:
- Git documentation about Add
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public AddCommand(Repository repo)
public AddCommand addFilepattern(String filepattern)
filepattern - File to add content from. Also a leading directory name (e.g.
dir to add dir/file1 and dir/file2) can be given to add all
files in the directory, recursively. Fileglobs (e.g. *.c) are
not yet supported.
public AddCommand setWorkingTreeIterator(WorkingTreeIterator f)
- Allow clients to provide their own implementation of a FileTreeIterator
public DirCache call()
- Executes the
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.
- Specified by:
call in interface
- Specified by:
call in class
- the DirCache after Add
GitAPIException - or subclass thereof when an error occurs
public AddCommand setUpdate(boolean update)
update - If set to true, the command only matches
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
exist also if update is set to true as there is no
concept of a working directory here.
public boolean isUpdate()
- is the parameter update is set
Copyright © 2012. All Rights Reserved.