Skip to content

Commit

Permalink
Run setIndex when revisionState==null
Browse files Browse the repository at this point in the history
The setIndex is not called when open exisiting 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.
  • Loading branch information
haiyanghaiyang committed Nov 3, 2021
1 parent cb4f26b commit e6d0784
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/main/java/hudson/plugins/repo/ManifestAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,27 +136,43 @@ 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();
}

/**
* Returns the manifest repository's url for this repo snapshot.
*/
public String getUrl() {
if (revisionState == null) {
setIndex(index);
}

return revisionState == null ? "" : revisionState.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();
}

/**
* Returns the path to the manifest file for this repo snapshot.
*/
public String getFile() {
if (revisionState == null) {
setIndex(index);
}

return revisionState == null ? "" : revisionState.getFile();
}
}

0 comments on commit e6d0784

Please sign in to comment.