Skip to content

Commit

Permalink
[JENKINS-17013] NullPointerException when no "Default" GitTool instal…
Browse files Browse the repository at this point in the history
…lation is set
  • Loading branch information
ndeloof committed Mar 11, 2013
1 parent d47ab3d commit d2e7c1f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -140,7 +140,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>git-client</artifactId>
<version>1.0.3</version>
<version>1.0.4-SNAPSHOT</version>
</dependency>

<dependency><!-- we contribute AbstractBuildParameters for Git if it's available -->
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/hudson/plugins/git/GitSCM.java
Expand Up @@ -1875,13 +1875,12 @@ private boolean isRevExcluded(GitClient git, Revision r, TaskListener listener,

@Initializer(after=PLUGINS_STARTED)
public static void onLoaded() {
GitTool.DescriptorImpl gitTools = Jenkins.getInstance().getDescriptorByType(GitTool.DescriptorImpl.class);
DescriptorImpl desc = Jenkins.getInstance().getDescriptorByType(DescriptorImpl.class);

if (desc.getOldGitExe() != null) {
String exe = desc.getOldGitExe();
GitTool tool = gitTools.getInstallation(GitTool.DEFAULT);
if (tool.getGitExe().equals(exe)) {
String defaultGit = GitTool.getDefaultInstallation().getGitExe();
if (defaultGit.equals(exe)) {
return;
}
System.err.println("[WARNING] you're using deprecated gitexe attribute to configure git plugin. Use Git installations");
Expand Down

0 comments on commit d2e7c1f

Please sign in to comment.