aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/resources/org/eclipse/jgit
diff options
context:
space:
mode:
authorNitzan Gur-Furman <nitzan@google.com>2023-03-03 14:24:19 +0100
committerNitzan Gur-Furman <nitzan@google.com>2023-03-28 11:18:08 +0200
commit3a913a8c341aba00f6b16aa1814ba75b83273972 (patch)
tree4c58cb9878948eb6f0764a165b2b37e575de38d9 /org.eclipse.jgit/resources/org/eclipse/jgit
parent228e4de4841a694bf55ff38212822fca46b7b080 (diff)
downloadjgit-3a913a8c341aba00f6b16aa1814ba75b83273972.tar.gz
jgit-3a913a8c341aba00f6b16aa1814ba75b83273972.zip
Fix PatchApplier error handling.
1. For general errors, throw IOException instead of wrapping them with PatchApplyException. The wrapping was moved (back) to ApplyCommand. 2. For file specific errors, log the errors as part of PatchApplier::Result. 3. Change applyPatch() to receive the parsed Patch object, so the caller can decide how to handle parsing errors. Background: this utility class was extracted from ApplyCommand on V6.4.0. During the extraction, we left the exception wrapping by PatchApplyException intact. This attitude made it harder for the callers to distinguish between the actual error causes. Change-Id: Ib0f2b5e97a13df2339d8b65f2fea1c819c161ac3
Diffstat (limited to 'org.eclipse.jgit/resources/org/eclipse/jgit')
-rw-r--r--org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties8
1 files changed, 7 insertions, 1 deletions
diff --git a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
index faea9cbea3..1655cce1e1 100644
--- a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
+++ b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
@@ -17,7 +17,11 @@ applyBinaryBaseOidWrong=Cannot apply binary patch; OID for file {0} does not mat
applyBinaryForInCoreNotSupported=Applying binary patch for inCore repositories is not yet supported
applyBinaryOidTooShort=Binary patch for file {0} does not have full IDs
applyBinaryPatchTypeNotSupported=Couldn't apply binary patch of type {0}
-applyBinaryResultOidWrong=Result of binary patch for file {0} has wrong OID.
+applyTextPatchCannotApplyHunk=Hunk cannot be applied
+applyTextPatchSingleClearingHunk=Expected a single hunk for clearing all content
+applyBinaryResultOidWrong=Result of binary patch for file {0} has wrong OID
+applyTextPatchUnorderedHunkApplications=Current hunk must be applied after the last hunk
+applyTextPatchUnorderedHunks=Got unordered hunks
applyingCommit=Applying {0}
archiveFormatAlreadyAbsent=Archive format already absent: {0}
archiveFormatAlreadyRegistered=Archive format already registered with different implementation: {0}
@@ -581,6 +585,8 @@ packWasDeleted=Pack file {0} was deleted, removing it from pack list
packWriterStatistics=Total {0,number,#0} (delta {1,number,#0}), reused {2,number,#0} (delta {3,number,#0})
panicCantRenameIndexFile=Panic: index file {0} must be renamed to replace {1}; until then repository is corrupt
patchApplyException=Cannot apply: {0}
+patchApplyErrorWithHunk=Error applying patch in {0}, hunk {1}: {2}
+patchApplyErrorWithoutHunk=Error applying patch in {0}: {1}
patchFormatException=Format error: {0}
pathNotConfigured=Submodule path is not configured
peeledLineBeforeRef=Peeled line before ref.