Skip to content

Commit 15840e4

Browse files
authored
Disable branch name validation (#7037)
This validation happens unconditionally after parsing a manifest, so even if a dependency may be unused or overidden which is undesirable and unexpected. We need to either provide context or move the validation, but this currently breaks builds in environments where the validation doesn't succeed, so to unblock, we can disable it. rdar://117330410
1 parent de5d5e5 commit 15840e4

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

Sources/PackageLoading/ManifestLoader+Validation.swift

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,8 @@ public struct ManifestValidator {
221221
// validate source control ref
222222
switch dependency.requirement {
223223
case .branch(let name):
224-
do {
225-
if try !self.sourceControlValidator.isValidRefFormat(name) {
226-
diagnostics.append(.invalidSourceControlBranchName(name))
227-
}
228-
} catch {
229-
diagnostics.append(.invalidSourceControlBranchName(name, underlyingError: error))
230-
}
224+
// FIXME: removed this validation because it is applied unconditionally, rdar://117442643 tracks restoring it once we can do it right
225+
break
231226
case .revision(let revision):
232227
do {
233228
if try !self.sourceControlValidator.isValidRefFormat(revision) {

Tests/FunctionalTests/MiscellaneousTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,8 @@ class MiscellaneousTestCase: XCTestCase {
338338
}
339339

340340
func testInvalidRefsValidation() throws {
341+
try XCTSkipIf(true, "skipping since we disabled the validation, see rdar://117442643")
342+
341343
try fixture(name: "Miscellaneous/InvalidRefs", createGitRepo: false) { fixturePath in
342344
do {
343345
XCTAssertThrowsError(try SwiftPM.Build.execute(packagePath: fixturePath.appending("InvalidBranch"))) { error in

0 commit comments

Comments
 (0)