Skip to content

Commit

Permalink
Use correct getters for note fields (#1607)
Browse files Browse the repository at this point in the history
* Use correct getters for note fields

* Reinstate old methods as deprecated.
  • Loading branch information
sboardwell authored Jul 15, 2024
1 parent 9f17f9a commit 2f52f89
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions src/main/java/hudson/plugins/git/GitPublisher.java
Original file line number Diff line number Diff line change
Expand Up @@ -332,15 +332,15 @@ else if (!tagExists) {

if (isPushNotes()) {
for (final NoteToPush b : notesToPush) {
if (b.getnoteMsg() == null)
if (b.getNoteMsg() == null)

Check warning on line 335 in src/main/java/hudson/plugins/git/GitPublisher.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 335 is only partially covered, one branch is missing
throw new AbortException("No note to push defined");

b.setEmptyTargetRepoToOrigin();
String noteMsgTmp = environment.expand(b.getnoteMsg());
String noteMsgTmp = environment.expand(b.getNoteMsg());
final String noteMsg = replaceAdditionalEnvironmentalVariables(noteMsgTmp, build);
final String noteNamespace = environment.expand(b.getnoteNamespace());
final String noteNamespace = environment.expand(b.getNoteNamespace());
final String targetRepo = environment.expand(b.getTargetRepoName());
final boolean noteReplace = b.getnoteReplace();
final boolean noteReplace = b.getNoteReplace();

try {
// Lookup repository with unexpanded name as GitSCM stores them unexpanded
Expand Down Expand Up @@ -579,18 +579,33 @@ public static final class NoteToPush extends PushConfig {
private String noteNamespace;
private boolean noteReplace;

@Deprecated
public String getnoteMsg() {
return noteMsg;
}

@Deprecated
public String getnoteNamespace() {
return noteNamespace;
}

@Deprecated
public boolean getnoteReplace() {
return noteReplace;
}

public String getNoteMsg() {
return noteMsg;
}

public String getNoteNamespace() {
return noteNamespace;
}

public boolean getNoteReplace() {
return noteReplace;
}

@DataBoundConstructor
public NoteToPush( String targetRepoName, String noteMsg, String noteNamespace, boolean noteReplace ) {
super(targetRepoName);
Expand Down

0 comments on commit 2f52f89

Please sign in to comment.