Closes #4593 The logic for finding existing source blocks requires that the same target files and hashes are adjacent in query results, but this was not the case.