} catch (NoRemoteRepositoryException err) {
String exp = uri + ": " + uri
+ "/info/refs?service=git-upload-pack not found";
- assertEquals(exp, err.getMessage());
+ assertNotNull(err.getMessage());
+ assertTrue("Unexpected error message",
+ err.getMessage().startsWith(exp));
}
}
}
} catch (NoRemoteRepositoryException err) {
String exp = uri + ": " + uri
+ "/info/refs?service=git-upload-pack not found";
- assertEquals(exp, err.getMessage());
+ assertNotNull(err.getMessage());
+ assertTrue("Unexpected error message",
+ err.getMessage().startsWith(exp));
}
}
}
upstreamBranchName=branch ''{0}'' of {1}
uriNotConfigured=Submodule URI not configured
uriNotFound={0} not found
+uriNotFoundWithMessage={0} not found: {1}
URINotSupported=URI not supported: {0}
-URLNotFound={0} not found
userConfigFileInvalid=User config file {0} invalid {1}
walkFailure=Walk failure.
wantNotValid=want {0} not valid
/***/ public String upstreamBranchName;
/***/ public String uriNotConfigured;
/***/ public String uriNotFound;
+ /***/ public String uriNotFoundWithMessage;
/***/ public String URINotSupported;
- /***/ public String URLNotFound;
/***/ public String userConfigFileInvalid;
/***/ public String walkFailure;
/***/ public String wantNotValid;
this.headers = headers;
}
+ private NoRemoteRepositoryException createNotFoundException(URIish u,
+ URL url, String msg) {
+ String text;
+ if (msg != null && !msg.isEmpty()) {
+ text = MessageFormat.format(JGitText.get().uriNotFoundWithMessage,
+ url, msg);
+ } else {
+ text = MessageFormat.format(JGitText.get().uriNotFound, url);
+ }
+ return new NoRemoteRepositoryException(u, text);
+ }
+
private HttpConnection connect(String service)
throws TransportException, NotSupportedException {
URL u = getServiceURL(service);
return conn;
case HttpConnection.HTTP_NOT_FOUND:
- throw new NoRemoteRepositoryException(uri,
- MessageFormat.format(JGitText.get().uriNotFound, u));
+ throw createNotFoundException(uri, u,
+ conn.getResponseMessage());
case HttpConnection.HTTP_UNAUTHORIZED:
authMethod = HttpAuthMethod.scanResponse(conn, ignoreTypes);
return;
case HttpConnection.HTTP_NOT_FOUND:
- throw new NoRemoteRepositoryException(uri,
- MessageFormat.format(JGitText.get().uriNotFound,
- conn.getURL()));
+ throw createNotFoundException(uri, conn.getURL(),
+ conn.getResponseMessage());
case HttpConnection.HTTP_FORBIDDEN:
throw new TransportException(uri,