fix #2936 add support for "pathed" branches

allow "/" in branch names
This commit is contained in:
Yuriy Husnay
2022-04-19 17:42:02 +03:00
parent fb82a5be46
commit 99a8c0d152
2 changed files with 39 additions and 25 deletions

View File

@@ -336,6 +336,20 @@ describe('when parsing a gitGraph', function () {
expect(Object.keys(parser.yy.getBranches()).length).toBe(2);
});
it('should allow _-./ characters in branch names', function () {
const str = `gitGraph:
commit
branch azAZ_-./test
`;
parser.parse(str);
const commits = parser.yy.getCommits();
expect(Object.keys(commits).length).toBe(1);
expect(parser.yy.getCurrentBranch()).toBe('azAZ_-./test');
expect(parser.yy.getDirection()).toBe('LR');
expect(Object.keys(parser.yy.getBranches()).length).toBe(2);
});
it('should handle new branch checkout', function () {
const str = `gitGraph:
commit