Skip to content

Commit

Permalink
fix: fall back to path when no repo URL provided
Browse files Browse the repository at this point in the history
  • Loading branch information
thisislawatts committed May 14, 2024
1 parent 6056deb commit ff1eb04
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scan/target.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func NewRepositoryTarget(path string, options ...TargetOptions) (Target, error)
var err error
result.repositoryUrl, err = util.GetRepositoryUrl(path)
if err != nil {
return &RepositoryTarget{}, err
return result, err
}
}

Expand Down
2 changes: 1 addition & 1 deletion scan/target_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestTarget_pathToNonRepo(t *testing.T) {
repoTarget, ok := target.(*RepositoryTarget)
assert.True(t, ok)
assert.Empty(t, repoTarget.GetRepositoryUrl())
assert.Empty(t, repoTarget.GetPath())
assert.Equal(t, expectedPath, repoTarget.GetPath())
}

func TestTarget_withRepoUrl(t *testing.T) {
Expand Down

0 comments on commit ff1eb04

Please sign in to comment.