Skip to content

Commit

Permalink
Add TODO to handle path-parsing error
Browse files Browse the repository at this point in the history
Remove non-parsable path test due to pending decision on intended behavior
  • Loading branch information
annasong20 committed Nov 11, 2022
1 parent a32229c commit 2c760fd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
1 change: 1 addition & 0 deletions api/internal/git/repospec.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ func parseQuery(query string) (string, time.Duration, bool) {
func parsePath(n string) string {
parsed, err := url.Parse(n)
// in event of parse failure, return default
// TODO(annasong): decide how to handle error, i.e. return error, empty string, etc.
if err != nil {
return n
}
Expand Down
12 changes: 0 additions & 12 deletions api/internal/git/repospec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,18 +443,6 @@ func TestNewRepoSpecFromUrl_Smoke(t *testing.T) {
GitSuffix: ".git",
},
},
{
name: "non_parsable_path",
input: "https://authority/org/repo/%-invalid-uri-so-not-parsable-by-net/url.Parse",
cloneSpec: "https://authority/org/repo.git",
absPath: notCloned.Join("%-invalid-uri-so-not-parsable-by-net/url.Parse"),
repoSpec: RepoSpec{
Host: "https://authority/",
OrgRepo: "org/repo",
Path: "%-invalid-uri-so-not-parsable-by-net/url.Parse",
GitSuffix: ".git",
},
},
}
for _, tc := range testcases {
t.Run(tc.name, func(t *testing.T) {
Expand Down

0 comments on commit 2c760fd

Please sign in to comment.