Skip to content

Commit a43688b

Browse files
Remove dead getOldGitExe() code (#3936)
* Remove dead getOldGitExe() code and empty onLoaded() block * remove onLoaded method * Deprecate method instead of deleting it Preserve API compatibility for consumers. Low risk to delete it, but it is simpler for maintainers if we retain the method rather than answer later questions about its removal. --------- Co-authored-by: Mark Waite <mark.earl.waite@gmail.com>
1 parent 0f378b3 commit a43688b

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

src/main/java/hudson/plugins/git/GitSCM.java

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1811,10 +1811,12 @@ public void setAllowSecondFetch(boolean allowSecondFetch) {
18111811
public void setAddGitTagAction(boolean addGitTagAction) { this.addGitTagAction = addGitTagAction; }
18121812

18131813
/**
1814-
* Old configuration of git executable - exposed so that we can
1815-
* migrate this setting to GitTool without deprecation warnings.
1816-
* @return git executable
1814+
* Old configuration of git executable, unused since 2023.
1815+
* Returns null in all cases.
1816+
* @deprecated use GitTool
1817+
* @return null
18171818
*/
1819+
@Deprecated(since = "5.11.0")
18181820
public String getOldGitExe() {
18191821
return null;
18201822
}
@@ -2166,21 +2168,6 @@ public boolean getDoGenerateSubmoduleConfigurations() {
21662168
return doGenerateSubmoduleConfigurations;
21672169
}
21682170

2169-
@Initializer(after=PLUGINS_STARTED)
2170-
public static void onLoaded() {
2171-
Jenkins jenkins = Jenkins.get();
2172-
DescriptorImpl desc = jenkins.getDescriptorByType(DescriptorImpl.class);
2173-
2174-
if (desc.getOldGitExe() != null) {
2175-
String exe = desc.getOldGitExe();
2176-
String defaultGit = GitTool.getDefaultInstallation().getGitExe();
2177-
if (exe.equals(defaultGit)) {
2178-
return;
2179-
}
2180-
System.err.println("[WARNING] you're using deprecated gitexe attribute to configure git plugin. Use Git installations");
2181-
}
2182-
}
2183-
21842171
@Initializer(before=JOB_LOADED)
21852172
public static void configureXtream() {
21862173
Run.XSTREAM.registerConverter(new ObjectIdConverter());

0 commit comments

Comments
 (0)