- java.lang.Object
-
- org.eclipse.jgit.patch.PatchApplier
-
public class PatchApplier extends Object
Applies a patch to files and the index.After instantiating, applyPatch() should be called once.
- Since:
- 6.4
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPatchApplier.ResultA wrapper for returning both the applied tree ID and the applied files list, as well as file specific errors.
-
Constructor Summary
Constructors Constructor Description PatchApplier(Repository repo)PatchApplier(Repository repo, RevTree beforeTree, ObjectInserter oi)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description PatchApplier.ResultapplyPatch(InputStream patchInput)Deprecated.useapplyPatch(Patch)insteadPatchApplier.ResultapplyPatch(Patch p)Applies the given patch
-
-
-
Constructor Detail
-
PatchApplier
public PatchApplier(Repository repo)
- Parameters:
repo- repository to apply the patch in
-
PatchApplier
public PatchApplier(Repository repo, RevTree beforeTree, ObjectInserter oi)
- Parameters:
repo- repository to apply the patch inbeforeTree- ID of the tree to apply the patch inoi- to be used for modifying objects
-
-
Method Detail
-
applyPatch
@Deprecated public PatchApplier.Result applyPatch(InputStream patchInput) throws PatchFormatException, IOException
Deprecated.useapplyPatch(Patch)insteadApplies the given patch- Parameters:
patchInput- the patch to apply.- Returns:
- the result of the patch
- Throws:
PatchFormatException- if the patch cannot be parsedIOException- if the patch read fails
-
applyPatch
public PatchApplier.Result applyPatch(Patch p) throws IOException
Applies the given patch- Parameters:
p- the patch to apply.- Returns:
- the result of the patch
- Throws:
IOException- Since:
- 6.6
-
-