public class ApplyCommand extends GitCommand<ApplyResult>
Modifier and Type | Field and Description |
---|---|
private java.io.InputStream |
in |
repo
Constructor and Description |
---|
ApplyCommand(Repository repo)
Constructs the command if the patch is to be applied to the index.
|
Modifier and Type | Method and Description |
---|---|
private void |
apply(java.io.File f,
FileHeader fh) |
ApplyResult |
call() |
private java.io.File |
getFile(java.lang.String path,
boolean create) |
private static boolean |
isChanged(java.util.List<java.lang.String> ol,
java.util.List<java.lang.String> nl) |
private boolean |
isNoNewlineAtEndOfFile(FileHeader fh) |
ApplyCommand |
setPatch(java.io.InputStream in)
Set patch
|
checkCallable, getRepository, setCallable
ApplyCommand(Repository repo)
repo
- public ApplyCommand setPatch(java.io.InputStream in)
in
- the patch to applypublic ApplyResult call() throws GitAPIException, PatchFormatException, PatchApplyException
Execute the command
Executes the ApplyCommand
command with all the options and
parameters collected by the setter methods (e.g.
setPatch(InputStream)
of this class. Each instance of this class
should only be used for one invocation of the command. Don't call this
method twice on an instance.
call
in interface java.util.concurrent.Callable<ApplyResult>
call
in class GitCommand<ApplyResult>
GitAPIException
PatchFormatException
PatchApplyException
private java.io.File getFile(java.lang.String path, boolean create) throws PatchApplyException
PatchApplyException
private void apply(java.io.File f, FileHeader fh) throws java.io.IOException, PatchApplyException
f
- fh
- java.io.IOException
PatchApplyException
private static boolean isChanged(java.util.List<java.lang.String> ol, java.util.List<java.lang.String> nl)
private boolean isNoNewlineAtEndOfFile(FileHeader fh)