From 8774f541904ca9afba1786b4da14c1aedf4dda78 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Fri, 26 Jun 2020 14:23:29 +0900 Subject: [PATCH] Improve error message when receive.maxCommandBytes is exceeded The message "Too many commands" implies there is a hard limit on the number of commands, which isn't the case. The limit is on the total size of the received data, as explained in change I84317d396 which introduced the configuration setting receive.maxCommandBytes: shorter reference names allow for more commands, longer reference names permit fewer commands per batch. Change the message to: Commands size exceeds limit defined in receive.maxCommandBytes Change-Id: I678b78f919b2fec8f8058f3403f2541c26a5d00e Signed-off-by: David Pursehouse --- .../tst/org/eclipse/jgit/transport/PushConnectionTest.java | 4 +++- .../resources/org/eclipse/jgit/internal/JGitText.properties | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java index 0179d8c26f..21fde3e76e 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java @@ -162,7 +162,9 @@ public class PushConnectionTest { fail("server did not abort"); } catch (TransportException e) { String msg = e.getMessage(); - assertEquals("remote: Too many commands", msg); + assertEquals( + "remote: Commands size exceeds limit defined in receive.maxCommandBytes", + msg); } } } 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 e6da551bb7..8cbcb0f67a 100644 --- a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties +++ b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties @@ -661,7 +661,7 @@ threadInterruptedWhileRunning="Current thread interrupted while running {0}" timeIsUncertain=Time is uncertain timerAlreadyTerminated=Timer already terminated timeoutMeasureFsTimestampResolution=measuring filesystem timestamp resolution for ''{0}'' timed out, fall back to resolution of 2 seconds -tooManyCommands=Too many commands +tooManyCommands=Commands size exceeds limit defined in receive.maxCommandBytes tooManyFilters=Too many "filter" lines in request tooManyIncludeRecursions=Too many recursions; circular includes in config file(s)? topologicalSortRequired=Topological sort required. -- 2.39.5