Change REUSE license scan to only check file changes

Change-Id: I2feeb6b694b0d74b39244910f16eeb8919bfdb92
diff --git a/jjb/pipeline/omec-fossa-scan.groovy b/jjb/pipeline/omec-fossa-scan.groovy
index f59f276..613b03e 100644
--- a/jjb/pipeline/omec-fossa-scan.groovy
+++ b/jjb/pipeline/omec-fossa-scan.groovy
@@ -40,7 +40,8 @@
             steps {
                 checkout([
                     $class: 'GitSCM',
-                    userRemoteConfigs: [[ url: "https://github.com/${params.ghprbGhRepository}", refspec: "+refs/pull/${params.ghprbPullId}/merge" ]],
+                    userRemoteConfigs: [[ url: "https://github.com/${params.ghprbGhRepository}", refspec: "pull/${params.ghprbPullId}/head" ]],
+                    extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: "${params.project}"]],
                     ],
                 )
             }
@@ -52,6 +53,7 @@
                     sh  """
                         #!/usr/bin/env bash
 
+                        cd ${params.project}
                         git checkout FETCH_HEAD
                         git show
 
diff --git a/jjb/pipeline/omec-reuse-scan.groovy b/jjb/pipeline/omec-reuse-scan.groovy
index f4fcf51..6b471ab 100644
--- a/jjb/pipeline/omec-reuse-scan.groovy
+++ b/jjb/pipeline/omec-reuse-scan.groovy
@@ -40,7 +40,8 @@
             steps {
                 checkout([
                     $class: 'GitSCM',
-                    userRemoteConfigs: [[ url: "https://github.com/${params.ghprbGhRepository}", refspec: "+refs/pull/${params.ghprbPullId}/merge" ]],
+                    userRemoteConfigs: [[ url: "https://github.com/${params.ghprbGhRepository}", refspec: "pull/${params.ghprbPullId}/head" ]],
+                    extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: "${params.project}"]],
                     ],
                 )
             }
@@ -51,9 +52,15 @@
                 sh  """
                     #!/usr/bin/env bash
 
+                    cd ${params.project}
                     git checkout FETCH_HEAD
                     git show
 
+                    mkdir ../jenkins-license-scan
+                    cp --parents $(git diff-tree --no-commit-id --name-only -r HEAD) ../jenkins-license-scan
+                    cd ../jenkins-license-scan
+
+                    reuse download --all
                     reuse lint
                     """
             }