Skip to content

Disable branch name validation #7037

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions Sources/PackageLoading/ManifestLoader+Validation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,8 @@ public struct ManifestValidator {
// validate source control ref
switch dependency.requirement {
case .branch(let name):
do {
if try !self.sourceControlValidator.isValidRefFormat(name) {
diagnostics.append(.invalidSourceControlBranchName(name))
}
} catch {
diagnostics.append(.invalidSourceControlBranchName(name, underlyingError: error))
}
// FIXME: removed this validation because it is applied unconditionally, rdar://117442643 tracks restoring it once we can do it right
break
case .revision(let revision):
do {
if try !self.sourceControlValidator.isValidRefFormat(revision) {
Expand Down
2 changes: 2 additions & 0 deletions Tests/FunctionalTests/MiscellaneousTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@ class MiscellaneousTestCase: XCTestCase {
}

func testInvalidRefsValidation() throws {
try XCTSkipIf(true, "skipping since we disabled the validation, see rdar://117442643")

try fixture(name: "Miscellaneous/InvalidRefs", createGitRepo: false) { fixturePath in
do {
XCTAssertThrowsError(try SwiftPM.Build.execute(packagePath: fixturePath.appending("InvalidBranch"))) { error in
Expand Down