From e820940649d09ec76b89286f8e15ef90105e9626 Mon Sep 17 00:00:00 2001 From: Hai Yang Date: Wed, 3 Nov 2021 21:48:06 +0800 Subject: [PATCH] Run setIndex when revisionState==null The setIndex is not called when open existing job's manifest information. At that time, revisionState==null, and the manifest cannot be fetched. The repo manifest information is blank on web. The fix just calls setIndex when revisionState==null before get manifest. --- .../java/hudson/plugins/repo/ManifestAction.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/java/hudson/plugins/repo/ManifestAction.java b/src/main/java/hudson/plugins/repo/ManifestAction.java index 2bac3b6..16b48a1 100644 --- a/src/main/java/hudson/plugins/repo/ManifestAction.java +++ b/src/main/java/hudson/plugins/repo/ManifestAction.java @@ -136,6 +136,10 @@ public final String getUrlName() { * Gets a String representation of the static manifest for this repo snapshot. */ public String getManifest() { + if (revisionState == null) { + setIndex(index); + } + return revisionState == null ? "" : revisionState.getManifest(); } @@ -143,6 +147,10 @@ public String getManifest() { * Returns the manifest repository's url for this repo snapshot. */ public String getUrl() { + if (revisionState == null) { + setIndex(index); + } + return revisionState == null ? "" : revisionState.getUrl(); } @@ -150,6 +158,10 @@ public String getUrl() { * Returns the manifest repository's branch name for this repo snapshot. */ public String getBranch() { + if (revisionState == null) { + setIndex(index); + } + return revisionState == null ? "" : revisionState.getBranch(); } @@ -157,6 +169,10 @@ public String getBranch() { * Returns the path to the manifest file for this repo snapshot. */ public String getFile() { + if (revisionState == null) { + setIndex(index); + } + return revisionState == null ? "" : revisionState.getFile(); } }