*
* @throws java.io.IOException
* an error occurred during unpacking or connectivity checking.
+ * @throws LargeObjectException
+ * an large object needs to be opened for the check.
+ * @throws SubmoduleValidationException
+ * fails to validate the submodule.
*/
- protected void receivePackAndCheckConnectivity() throws IOException {
+ protected void receivePackAndCheckConnectivity() throws IOException,
+ LargeObjectException, SubmoduleValidationException {
receivePack();
if (needCheckConnectivity()) {
checkSubmodules();
|| !getClientShallowCommits().isEmpty();
}
- private void checkSubmodules() throws IOException {
+ private void checkSubmodules() throws IOException, LargeObjectException,
+ SubmoduleValidationException {
ObjectDatabase odb = db.getObjectDatabase();
if (objectChecker == null) {
return;
AnyObjectId blobId = entry.getBlobId();
ObjectLoader blob = odb.open(blobId, Constants.OBJ_BLOB);
- try {
- SubmoduleValidator.assertValidGitModulesFile(
- new String(blob.getBytes(), UTF_8));
- } catch (LargeObjectException | SubmoduleValidationException e) {
- throw new IOException(e);
- }
+ SubmoduleValidator.assertValidGitModulesFile(
+ new String(blob.getBytes(), UTF_8));
}
}
if (needPack()) {
try {
receivePackAndCheckConnectivity();
- } catch (IOException | RuntimeException | Error err) {
+ } catch (IOException | RuntimeException
+ | SubmoduleValidationException | Error err) {
unpackError = err;
}
}