Skip to content

Commit 7f7848e

Browse files
authored
Merge pull request #149 from snyk/fix/remote-only-check
fix: Enforce remote-only check for lastModifiedDate everywhere.
2 parents 948ffee + 2701270 commit 7f7848e

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

core/src/main/java/io/snyk/plugins/artifactory/scanner/ScannerModule.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,19 @@ private void filter(RepoPath repoPath, MonitoredArtifact artifact) {
121121
Ignores ignores = Ignores.read(new RepositoryArtifactProperties(repoPath, repositories));
122122
Instant lastModifiedDate = getLastModifiedDate(repoPath);
123123

124+
return new MonitoredArtifact(repoPath.toString(), testResult, ignores, lastModifiedDate);
125+
}
126+
127+
private Instant getLastModifiedDate(RepoPath repoPath) {
124128
// Only apply lastModifiedDate to packages from remote repositories.
125129
if(lastModifiedDateRemoteOnly()) {
126130
LOG.debug("Last modified date applied to only remote repositories.");
127131
if (!isRemoteRepository(repoPath)) {
128-
LOG.debug("Repository provided is not a remote repository, skipping last modified date check.");
129-
lastModifiedDate = null;
132+
LOG.debug("Provided repository is not a remote repository, skipping last modified date check for {}", repoPath);
133+
return null;
130134
}
131135
}
132-
return new MonitoredArtifact(repoPath.toString(), testResult, ignores, lastModifiedDate);
133-
}
134-
135-
private Instant getLastModifiedDate(RepoPath repoPath) {
136+
136137
try {
137138
ItemInfo itemInfo = repositories.getItemInfo(repoPath);
138139
if (itemInfo != null) {

0 commit comments

Comments
 (0)