Skip to content

Commit

Permalink
Remove incorrect annotation on GitSCM.getBrowser()
Browse files Browse the repository at this point in the history
Jesse Glick notes in https://issues.jenkins.io/browse/JENKINS-75288:

> adding @Whitelisted to a method already marked @OverRide is clearly
> a mistake—this would never have any effect.

I didn't realize that was a mistake when I added the annotation.
Let's remove the annotation so that the code does not mislead someone
to think that this can be used from a Pipeline without changes to
hudson.scm.SCM.getBrowser().

In a multibranch Pipeline, the default checkout assigns current values
to the scm object, including scm.browser.  That value can't be read
unless the hudson.scm.SCM.getBrowser() method is approved through script
security.
  • Loading branch information
MarkEWaite committed Mar 10, 2025
1 parent 18494b3 commit 1ccf172
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/main/java/hudson/plugins/git/GitSCM.java
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ public Object readResolve() throws IOException, GitException {
}

@Override
@Whitelisted
public GitRepositoryBrowser getBrowser() {
return browser;
}
Expand Down

0 comments on commit 1ccf172

Please sign in to comment.