Skip to content

Commit ff1eb04

Browse files
committed
fix: fall back to path when no repo URL provided
1 parent 6056deb commit ff1eb04

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

scan/target.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func NewRepositoryTarget(path string, options ...TargetOptions) (Target, error)
4242
var err error
4343
result.repositoryUrl, err = util.GetRepositoryUrl(path)
4444
if err != nil {
45-
return &RepositoryTarget{}, err
45+
return result, err
4646
}
4747
}
4848

scan/target_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func TestTarget_pathToNonRepo(t *testing.T) {
2323
repoTarget, ok := target.(*RepositoryTarget)
2424
assert.True(t, ok)
2525
assert.Empty(t, repoTarget.GetRepositoryUrl())
26-
assert.Empty(t, repoTarget.GetPath())
26+
assert.Equal(t, expectedPath, repoTarget.GetPath())
2727
}
2828

2929
func TestTarget_withRepoUrl(t *testing.T) {

0 commit comments

Comments
 (0)