diff --git a/bats/empty-repo.bats b/bats/empty-repo.bats index 58584a2151..5ae5bb4626 100755 --- a/bats/empty-repo.bats +++ b/bats/empty-repo.bats @@ -203,9 +203,8 @@ teardown() { [ "$output" = "" ] } -@test "unsupported branch characters" { - run dolt branch "are.dots.supported" - skip "branch names with . panic right now" - [ "$status" -eq 0 ] - [ "$output" = "" ] -} \ No newline at end of file +@test "branch names do not support ." { + run dolt branch "dots.are.not.supported" + [ "$status" -eq 1 ] + [ "$output" = "fatal: 'dots.are.not.supported' is an invalid branch name." ] +} diff --git a/go/go.sum b/go/go.sum index d1be1c6aa1..5293959f49 100644 --- a/go/go.sum +++ b/go/go.sum @@ -260,6 +260,8 @@ github.com/liquidata-inc/go-mysql-server v0.4.1-0.20191003230430-3a1a09c79ada h1 github.com/liquidata-inc/go-mysql-server v0.4.1-0.20191003230430-3a1a09c79ada/go.mod h1:DdWE0ku/mNfuLsRJIrHeHpDtB7am+6oopxEsQKmVkx8= github.com/liquidata-inc/go-mysql-server v0.4.1-0.20191017183442-4b9329eafa5b h1:fdht6iaUhHYJEfSUY1m1KAghyi6zfyfv+12gaSsaQ+o= github.com/liquidata-inc/go-mysql-server v0.4.1-0.20191017183442-4b9329eafa5b/go.mod h1:DdWE0ku/mNfuLsRJIrHeHpDtB7am+6oopxEsQKmVkx8= +github.com/liquidata-inc/go-mysql-server v0.4.1-0.20191102000214-fa72192f51a9 h1:Pux1QrTx2Q2WF0Ayyz9doIlYJP/REAhfRP7mRyoiowE= +github.com/liquidata-inc/go-mysql-server v0.4.1-0.20191102000214-fa72192f51a9/go.mod h1:DdWE0ku/mNfuLsRJIrHeHpDtB7am+6oopxEsQKmVkx8= github.com/liquidata-inc/ishell v0.0.0-20190514193646-693241f1f2a0 h1:phMgajKClMUiIr+hF2LGt8KRuUa2Vd2GI1sNgHgSXoU= github.com/liquidata-inc/ishell v0.0.0-20190514193646-693241f1f2a0/go.mod h1:YC1rI9k5gx8D02ljlbxDfZe80s/iq8bGvaaQsvR+qxs= github.com/liquidata-inc/mmap-go v1.0.3 h1:2LndAeAtup9rpvUmu4wZSYCsjCQ0Zpc+NqE+6+PnT7g= diff --git a/go/libraries/doltcore/ref/branchname.go b/go/libraries/doltcore/ref/branchname.go index edbbfacf46..88f6e2a07e 100644 --- a/go/libraries/doltcore/ref/branchname.go +++ b/go/libraries/doltcore/ref/branchname.go @@ -21,12 +21,12 @@ import ( // The following list of patterns are all forbidden in a branch name. var InvalidBranchNameRegex = regexp.MustCompile(strings.Join([]string{ + // Any appearance of a period, currently unsupported by noms layer + `[.*]`, // Any appearance of the following characters: :, ?, [, \, ^, ~, SPACE, TAB, * `:`, `\?`, `\[`, `\\`, `\^`, `~`, ` `, `\t`, `\*`, // Any ASCII control character. `[\x00-\x1f]`, `\x7f`, - // Any component starting with a "." - `\A\.`, `/\.`, // Any component ending with ".lock" `\.lock\z`, `\.lock\/`, // An exact name of "", "HEAD" or "-" diff --git a/go/libraries/doltcore/ref/branchname_test.go b/go/libraries/doltcore/ref/branchname_test.go index f79950f6e2..d573f5befa 100644 --- a/go/libraries/doltcore/ref/branchname_test.go +++ b/go/libraries/doltcore/ref/branchname_test.go @@ -25,8 +25,8 @@ func TestBranchName(t *testing.T) { assert.Equal(t, true, IsValidBranchName("☃️")) assert.Equal(t, true, IsValidBranchName("user/in-progress/do-some-things")) assert.Equal(t, true, IsValidBranchName("user/in-progress/{}")) - assert.Equal(t, true, IsValidBranchName("user/{/a.tt/}")) + assert.Equal(t, false, IsValidBranchName("user/{/a.tt/}")) assert.Equal(t, false, IsValidBranchName("")) assert.Equal(t, false, IsValidBranchName("this-is-a-..-test")) assert.Equal(t, false, IsValidBranchName("this-is-a-@{-test"))