diff options
author | Ronald Bhuleskar <funronald@google.com> | 2022-04-20 10:28:30 -0700 |
---|---|---|
committer | Ronald Bhuleskar <funronald@google.com> | 2022-06-15 16:42:39 -0400 |
commit | 7f4fa5655abfcf731fd4a3869620b4e6dc55998e (patch) | |
tree | d156fd64f4bac7f8b181e91add6f8cc4ee5b0abf /org.eclipse.jgit/src/org/eclipse/jgit | |
parent | 5868543f1717f643342388d7476e1869edc8e9f7 (diff) | |
download | jgit-7f4fa5655abfcf731fd4a3869620b4e6dc55998e.tar.gz jgit-7f4fa5655abfcf731fd4a3869620b4e6dc55998e.zip |
Annotate the exception with the possible failure reason when Bitmaps are not enabled.
When bitmaps are not enabled the RevWalk is expensive. AllowFilter
provides an override to continue walking. PedestrianWalk can be
expensive and fails when the clone is a partial clone using
--filter=tree:0. This can only work when bitmaps are enabled.
Having a message to the exception improves debuggability of such cases.
Change-Id: Ie61de20a39a765e6f6f77e81b4c3bbda2eefbaf3
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java index b5062fdd1a..8b47d846a8 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java @@ -2023,7 +2023,8 @@ public class UploadPack { .filter(obj -> !(obj instanceof RevCommit)) .limit(1) .collect(Collectors.toList()).get(0); - throw new WantNotValidException(nonCommit); + throw new WantNotValidException(nonCommit, + new Exception("Cannot walk without bitmaps")); //$NON-NLS-1$ } try (ObjectWalk objWalk = walk.toObjectWalkWithSameObjects()) { @@ -2037,6 +2038,11 @@ public class UploadPack { Optional<RevObject> unreachable = reachabilityChecker .areAllReachable(wantsAsObjs, startersAsObjs); if (unreachable.isPresent()) { + if (!repoHasBitmaps) { + throw new WantNotValidException( + unreachable.get(), new Exception( + "Retry with bitmaps enabled")); //$NON-NLS-1$ + } throw new WantNotValidException(unreachable.get()); } } |