Skip to content
Permalink
Browse files

[JENKINS-42310] Git Shallow Lint defect support Maven and Matrix proj…

…ects
  • Loading branch information...
v1v committed Feb 25, 2017
1 parent 03de2c2 commit ac23bed3356a55e3f56b57bec813eec7139bd0fb
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/main/java/org/jenkins/ci/plugins/jenkinslint/check/GitShallowChecker.java
@@ -1,7 +1,7 @@
package org.jenkins.ci.plugins.jenkinslint.check;

import hudson.model.Item;
import hudson.model.Project;
import hudson.model.AbstractProject;
import jenkins.model.Jenkins;
import org.jenkins.ci.plugins.jenkinslint.model.AbstractCheck;

@@ -21,13 +21,13 @@ public GitShallowChecker() {
}

public boolean executeCheck(Item item) {
if (item instanceof Project) {
if (item instanceof AbstractProject) {
if (Jenkins.getInstance().pluginManager.getPlugin("git")!=null) {
if (((Project) item).getScm().getClass().getName().endsWith("GitSCM")) {
if (((AbstractProject) item).getScm().getClass().getName().endsWith("GitSCM")) {
boolean status = true;
try {
Method method = ((Project) item).getScm().getClass().getMethod("getExtensions", null);
Object extensionsList = method.invoke( ((Project) item).getScm());
Method method = ((AbstractProject) item).getScm().getClass().getMethod("getExtensions", null);
Object extensionsList = method.invoke( ((AbstractProject) item).getScm());
if (extensionsList instanceof AbstractList) {
for (Object extension : ((AbstractList) extensionsList) ) {
if (extension.getClass().getName().endsWith("CloneOption")) {

0 comments on commit ac23bed

Please sign in to comment.
You can’t perform that action at this time.