Skip to content

Commit

Permalink
Merge pull request #63 from finestructure/allow-numbers-in-branch-name
Browse files Browse the repository at this point in the history
Allow numbers in branch name
  • Loading branch information
finestructure authored Aug 28, 2020
2 parents 5f6dd70 + 7c99c12 commit 9d350ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/ArenaCore/Parser+ext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import SemanticVersion


// https://mirrors.edge.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html
let AllowedBranchCharacters = CharacterSet.letters.union(CharacterSet(charactersIn: ".-@/"))
let AllowedBranchCharacters = CharacterSet.alphanumerics.union(CharacterSet(charactersIn: ".-@/"))
let AllowedStartBranchCharacters = AllowedBranchCharacters.subtracting(CharacterSet(charactersIn: "/"))
let AllowedEndBranchCharacters = AllowedBranchCharacters.subtracting(CharacterSet(charactersIn: "/."))

Expand Down
5 changes: 5 additions & 0 deletions Tests/ArenaTests/ParserTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ class ParserTests: XCTestCase {
XCTAssertEqual(branchName.run("foo/"), Match(result: nil, rest: "foo/"))
}

func test_parse_branchName_v5() throws {
// Test for issue https://github.com/finestructure/Arena/issues/62
XCTAssertEqual(branchName.run("v5-develop"), Match(result: "v5-develop", rest: ""))
}

func test_parse_branch() {
XCTAssertEqual(Parser.branch.run("@branch:develop"), Match(result: .branch("develop"), rest: ""))
}
Expand Down

0 comments on commit 9d350ab

Please sign in to comment.