Skip to content

Commit 43ac7e9

Browse files
authored
Merge pull request #18 from arduino/dup-system-update
Use submission list from base ref for duplicate URL check
2 parents 6c26c70 + ba1fb4f commit 43ac7e9

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

main.go

+2-6
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ func populateSubmission(submissionURL string, listPath *paths.Path) (submissionT
246246

247247
// Check if the URL is already in the index.
248248
listLines, err := listPath.ReadFileAsLines()
249-
occurrences := 0
250249
for _, listURL := range listLines {
251250
listURLObject, err := url.Parse(strings.TrimSpace(listURL))
252251
if err != nil {
@@ -255,11 +254,8 @@ func populateSubmission(submissionURL string, listPath *paths.Path) (submissionT
255254

256255
normalizedListURLObject := normalizeURL(listURLObject)
257256
if normalizedListURLObject.String() == normalizedURLObject.String() {
258-
occurrences++
259-
if occurrences > 1 {
260-
submission.Error = "Submission URL is already in the Library Manager index."
261-
return submission, ""
262-
}
257+
submission.Error = "Submission URL is already in the Library Manager index."
258+
return submission, ""
263259
}
264260
}
265261

0 commit comments

Comments
 (0)