mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-25 18:49:11 +03:00
fix: allow periods in git refs through slugify()
This commit is contained in:
parent
ef3511c8c7
commit
5b355935a0
@ -39,6 +39,10 @@ describe.concurrent('branch slugify with valid characters', () => {
|
|||||||
test('underscores are fine', () => {
|
test('underscores are fine', () => {
|
||||||
expect(slugify('my_branch')).toEqual('my_branch');
|
expect(slugify('my_branch')).toEqual('my_branch');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('periods are fine', () => {
|
||||||
|
expect(slugify('my.branch')).toEqual('my.branch');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe.concurrent('branch slugify with replaced characters', () => {
|
describe.concurrent('branch slugify with replaced characters', () => {
|
||||||
|
@ -44,7 +44,7 @@ export function slugify(input: string) {
|
|||||||
.normalize('NFKD')
|
.normalize('NFKD')
|
||||||
.replace(/[\u0300-\u036f]/g, '')
|
.replace(/[\u0300-\u036f]/g, '')
|
||||||
.trim()
|
.trim()
|
||||||
.replace(/[^A-Za-z0-9_/ -]/g, '')
|
.replace(/[^A-Za-z0-9._/ -]/g, '')
|
||||||
.replace(/\s+/g, '-')
|
.replace(/\s+/g, '-')
|
||||||
.replace(/-+/g, '-');
|
.replace(/-+/g, '-');
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user