Accept semicolon right after branch_create command

This commit is contained in:
Stas Kelvich
2021-05-19 15:57:25 +03:00
parent 4d5a41301d
commit 8faa6fa392

View File

@@ -730,7 +730,7 @@ impl Connection {
// branch_create <branchname> <startpoint>
// TODO lazy static
// TOOD: escaping, to allow branch names with spaces
let re = Regex::new(r"^branch_create (\S+) (\S+)[\r\n\s]*;?$").unwrap();
let re = Regex::new(r"^branch_create (\S+) ([^\r\n\s;]+)[\r\n\s;]*;?$").unwrap();
let caps = re.captures(&query_str).ok_or_else(err)?;
let branchname: String = String::from(caps.get(1).ok_or_else(err)?.as_str());