mirror of
https://github.com/anchore/syft.git
synced 2026-10-31 14:36:33 +01:00
fix: index file itself when file scan path has symlink (#2359)
Previously, building the index of the filesystem when source was file would fail if part of the path syft was passed to the file included a symlinked directory, resulting in cataloging misses. --------- Signed-off-by: Will Murphy <will.murphy@anchore.com>
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func Test_RequestedPathIncludesSymlink(t *testing.T) {
|
||||
// path contains a symlink
|
||||
path := "test-fixtures/image-pkg-coverage/pkgs/java/example-java-app-maven-0.1.0.jar"
|
||||
_, stdout, _ := runSyft(t, nil, "packages", path)
|
||||
assert.Contains(t, stdout, "example-java-app-maven")
|
||||
}
|
||||
Reference in New Issue
Block a user