t.fetch(NullProgressMonitor.INSTANCE, mirror(master));
fail("Should have failed (too many redirects)");
} catch (TransportException e) {
- String expectedMessageBegin = MessageFormat.format(
- JGitText.get().redirectLimitExceeded, remoteUri, "3",
- remoteUri.replace("/4/", "/1/") + '/', "");
+ String expectedMessageBegin = remoteUri.toString() + ": "
+ + MessageFormat.format(JGitText.get().redirectLimitExceeded,
+ "3", remoteUri.replace("/4/", "/1/") + '/', "");
String message = e.getMessage();
if (message.length() > expectedMessageBegin.length()) {
message = message.substring(0, expectedMessageBegin.length());
t.fetch(NullProgressMonitor.INSTANCE, mirror(master));
fail("Should have failed (redirect loop)");
} catch (TransportException e) {
- assertTrue(e.getMessage().contains("redirected more than"));
+ assertTrue(e.getMessage().contains("Redirected more than"));
}
}
invalidPathPeriodAtEndWindows=Invalid path (period at end is ignored by Windows): {0}
invalidPathSpaceAtEndWindows=Invalid path (space at end is ignored by Windows): {0}
invalidPathReservedOnWindows=Invalid path (''{0}'' is reserved on Windows): {1}
-invalidRedirectLocation=Invalid redirect location {1} -> {2}
+invalidRedirectLocation=Invalid redirect location {0} -> {1}
invalidReflogRevision=Invalid reflog revision: {0}
invalidRefName=Invalid ref name: {0}
invalidReftableBlock=Invalid reftable block
receivePackInvalidLimit=Illegal limit parameter value {0}
receivePackTooLarge=Pack exceeds the limit of {0} bytes, rejecting the pack
receivingObjects=Receiving objects
-redirectBlocked=URI ''{0}'' redirection blocked: redirect {1} -> {2} not allowed
+redirectBlocked=Redirection blocked: redirect {0} -> {1} not allowed
redirectHttp=URI ''{0}'': following HTTP redirect #{1} {2} -> {3}
-redirectLimitExceeded=URI ''{0}'' redirected more than {1} times; aborted at {2} -> {3}
-redirectLocationMissing=Invalid redirect of ''{0}'': no redirect location for {1}
-redirectsOff=Cannot redirect ''{0}'': http.followRedirects is false (HTTP status {1})
+redirectLimitExceeded=Redirected more than {0} times; aborted at {1} -> {2}
+redirectLocationMissing=Invalid redirect: no redirect location for {0}
+redirectsOff=Cannot redirect because http.followRedirects is false (HTTP status {0})
refAlreadyExists=already exists
refAlreadyExists1=Ref {0} already exists
reflogEntryNotFound=Entry {0} not found in reflog for ''{1}''
timerAlreadyTerminated=Timer already terminated
tooManyCommands=Too many commands
tooManyIncludeRecursions=Too many recursions; circular includes in config file(s)?
-tooManyRedirects=Too many redirects; stopped after {0} redirects at ''{1}''
topologicalSortRequired=Topological sort required.
transactionAborted=transaction aborted
transportExceptionBadRef=Empty ref: {0}: {1}
case HttpConnection.HTTP_FORBIDDEN:
throw new TransportException(uri, MessageFormat.format(
- JGitText.get().serviceNotPermitted, service));
+ JGitText.get().serviceNotPermitted, baseUrl,
+ service));
case HttpConnection.HTTP_MOVED_PERM:
case HttpConnection.HTTP_MOVED_TEMP:
// and in general should occur only on POST requests. But it
// doesn't hurt to accept it here as a redirect.
if (http.followRedirects == HttpRedirectMode.FALSE) {
- throw new TransportException(MessageFormat.format(
- JGitText.get().redirectsOff, uri,
- Integer.valueOf(status)));
+ throw new TransportException(uri,
+ MessageFormat.format(
+ JGitText.get().redirectsOff,
+ Integer.valueOf(status)));
}
URIish newUri = redirect(conn.getHeaderField(HDR_LOCATION),
Constants.INFO_REFS, redirects++);
private URIish redirect(String location, String checkFor, int redirects)
throws TransportException {
if (location == null || location.isEmpty()) {
- throw new TransportException(MessageFormat.format(
- JGitText.get().redirectLocationMissing, uri, baseUrl));
+ throw new TransportException(uri,
+ MessageFormat.format(JGitText.get().redirectLocationMissing,
+ baseUrl));
}
if (redirects >= http.maxRedirects) {
- throw new TransportException(MessageFormat.format(
- JGitText.get().redirectLimitExceeded, uri,
+ throw new TransportException(uri,
+ MessageFormat.format(JGitText.get().redirectLimitExceeded,
Integer.valueOf(http.maxRedirects), baseUrl, location));
}
try {
if (!isValidRedirect(baseUrl, location, checkFor)) {
- throw new TransportException(
+ throw new TransportException(uri,
MessageFormat.format(JGitText.get().redirectBlocked,
- uri, baseUrl, location));
+ baseUrl, location));
}
location = location.substring(0, location.indexOf(checkFor));
URIish result = new URIish(location);
if (LOG.isInfoEnabled()) {
- LOG.info(MessageFormat.format(JGitText.get().redirectHttp, uri,
+ LOG.info(MessageFormat.format(JGitText.get().redirectHttp,
+ uri.setPass(null),
Integer.valueOf(redirects), baseUrl, result));
}
return result;
} catch (URISyntaxException e) {
- throw new TransportException(MessageFormat.format(
- JGitText.get().invalidRedirectLocation,
- uri, baseUrl, location), e);
+ throw new TransportException(uri,
+ MessageFormat.format(JGitText.get().invalidRedirectLocation,
+ baseUrl, location),
+ e);
}
}