aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2022-09-06 15:58:47 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2022-09-06 15:58:47 +0200
commit370d1170e8cb1b93120e19e50c0648605ed95b52 (patch)
tree02d1864c36dc3a9373c313d3fc195d9fe35a4bbe /org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java
parent7c4a5421ccd16b84b1ea4f3c1e566bfdf9c0e30d (diff)
parent57087e2b92dda967f6e5e0e0a017afae2f782a80 (diff)
downloadjgit-370d1170e8cb1b93120e19e50c0648605ed95b52.tar.gz
jgit-370d1170e8cb1b93120e19e50c0648605ed95b52.zip
Merge branch 'master' into stable-6.3
* master: Move WorkTreeUpdater to merge package WorkTreeUpdater: use DirCacheCheckout#StreamSupplier DirCacheCheckout#getContent: also take InputStream supplier WorkTreeUpdater: remove safeWrite option Change-Id: I8be570dbc4ad0d0b46046b85cbda24c3adcba170
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java14
1 files changed, 4 insertions, 10 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java
index 64fba98b49..e7f40d811b 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/ApplyCommand.java
@@ -58,7 +58,6 @@ import org.eclipse.jgit.util.FS.ExecutionResult;
import org.eclipse.jgit.util.FileUtils;
import org.eclipse.jgit.util.IO;
import org.eclipse.jgit.util.RawParseUtils;
-import org.eclipse.jgit.util.WorkTreeUpdater;
import org.eclipse.jgit.util.StringUtils;
import org.eclipse.jgit.util.TemporaryBuffer;
import org.eclipse.jgit.util.TemporaryBuffer.LocalFile;
@@ -398,7 +397,7 @@ public class ApplyCommand extends GitCommand<ApplyResult> {
}
private void applyBinary(Repository repository, String path, File f,
- FileHeader fh, WorkTreeUpdater.StreamSupplier loader, ObjectId id,
+ FileHeader fh, DirCacheCheckout.StreamSupplier loader, ObjectId id,
CheckoutMetadata checkOut)
throws PatchApplyException, IOException {
if (!fh.getOldId().isComplete() || !fh.getNewId().isComplete()) {
@@ -430,9 +429,7 @@ public class ApplyCommand extends GitCommand<ApplyResult> {
hunk.getBuffer(), start,
length))))) {
DirCacheCheckout.getContent(repository, path, checkOut,
- WorkTreeUpdater.createStreamLoader(() -> inflated,
- hunk.getSize()),
- null, out);
+ () -> inflated, null, out);
if (!fh.getNewId().toObjectId().equals(hash.toObjectId())) {
throw new PatchApplyException(MessageFormat.format(
JGitText.get().applyBinaryResultOidWrong,
@@ -463,8 +460,7 @@ public class ApplyCommand extends GitCommand<ApplyResult> {
SHA1InputStream hashed = new SHA1InputStream(hash,
input)) {
DirCacheCheckout.getContent(repository, path, checkOut,
- WorkTreeUpdater.createStreamLoader(() -> hashed, finalSize),
- null, out);
+ () -> hashed, null, out);
if (!fh.getNewId().toObjectId()
.equals(hash.toObjectId())) {
throw new PatchApplyException(MessageFormat.format(
@@ -632,9 +628,7 @@ public class ApplyCommand extends GitCommand<ApplyResult> {
}
try (OutputStream output = new FileOutputStream(f)) {
DirCacheCheckout.getContent(repository, path, checkOut,
- WorkTreeUpdater.createStreamLoader(buffer::openInputStream,
- buffer.length()),
- null, output);
+ buffer::openInputStream, null, output);
}
} finally {
buffer.destroy();