- 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.
-
Constructor Summary
Constructors Constructor Description PatchApplier(Repository repo)PatchApplier(Repository repo, RevTree beforeTree, ObjectInserter oi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PatchApplier.ResultapplyPatch(InputStream patchInput)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) throws IOException
- Parameters:
repo- repository to apply the patch inbeforeTree- ID of the tree to apply the patch inoi- to be used for modifying objects- Throws:
IOException- in case of I/O errors
-
-
Method Detail
-
applyPatch
public PatchApplier.Result applyPatch(InputStream patchInput) throws PatchFormatException, PatchApplyException
Applies the given patch- Parameters:
patchInput- the patch to apply.- Returns:
- the result of the patch
- Throws:
PatchFormatException- if the patch cannot be parsedPatchApplyException- if the patch cannot be applied
-
-