commit | 406ef8f072ae68c736129ac294eff243ba797fed | [log] [tgz] |
---|---|---|
author | Kenny Ho <y2kenny@gmail.com> | Mon Oct 03 14:55:41 2016 -0400 |
committer | Kenny Ho <y2kenny@gmail.com> | Mon Oct 03 15:09:52 2016 -0400 |
tree | 51f6dcc96b3f05c1bfff0a9ca75e3f9b5b30fa95 | |
parent | 0b7af94bd3d390fa1a260f07c5dc9a33657b6b2d [diff] |
Check for commit without any parent Also provide more logs on bad manifests Change-Id: I704d6867512344107495d1c36d3b295580c5d310
diff --git a/src/main/java/com/amd/gerrit/plugins/manifestsubscription/Utilities.java b/src/main/java/com/amd/gerrit/plugins/manifestsubscription/Utilities.java index 08e9807..68e80e4 100644 --- a/src/main/java/com/amd/gerrit/plugins/manifestsubscription/Utilities.java +++ b/src/main/java/com/amd/gerrit/plugins/manifestsubscription/Utilities.java
@@ -128,7 +128,7 @@ // May be related: // https://code.google.com/p/gerrit/issues/detail?id=2564 // https://gerrit-review.googlesource.com/55540 - if (commit != null) { + if (commit != null && commit.getParents().length > 0) { changeHooks.doRefUpdatedHook(new Branch.NameKey(p, refName), commit.getParent(0).getId(), commit.getId(), null);
diff --git a/src/main/java/com/amd/gerrit/plugins/manifestsubscription/VersionedManifests.java b/src/main/java/com/amd/gerrit/plugins/manifestsubscription/VersionedManifests.java index 0309363..6f7b7d3 100644 --- a/src/main/java/com/amd/gerrit/plugins/manifestsubscription/VersionedManifests.java +++ b/src/main/java/com/amd/gerrit/plugins/manifestsubscription/VersionedManifests.java
@@ -331,7 +331,10 @@ p = new Project.NameKey(projectName); try (Repository db = gitRepoManager.openRepository(p)) { hash = db.resolve(ref).getName(); - } catch (IOException e) { + } catch (IOException | NullPointerException e) { + log.warn(ref); + log.warn(projectName); + log.warn(defaultRef); e.printStackTrace(); } }