Skip to content

Commit 7ccfdd3

Browse files
committed
do not sanitize remote url
1 parent 9fb1a06 commit 7ccfdd3

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

extensions/git/src/commands.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,12 +1809,7 @@ export class CommandCenter {
18091809

18101810
const sanitize = (name: string) => {
18111811
name = name.trim();
1812-
1813-
if (!name) {
1814-
return name;
1815-
}
1816-
1817-
return name.replace(/^\.|\/\.|\.\.|~|\^|:|\/$|\.lock$|\.lock\/|\\|\*|\s|^\s*$|\.$|\[|\]$/g, '-');
1812+
return name && name.replace(/^\.|\/\.|\.\.|~|\^|:|\/$|\.lock$|\.lock\/|\\|\*|\s|^\s*$|\.$|\[|\]$/g, '-');
18181813
};
18191814

18201815
const resultName = await window.showInputBox({
@@ -1836,18 +1831,16 @@ export class CommandCenter {
18361831
}
18371832

18381833
if (remotes.find(r => r.name === name)) {
1839-
window.showErrorMessage(localize('remote already exists', 'Remote by name \"{0}\" already exists.', name));
1834+
window.showErrorMessage(localize('remote already exists', "Remote '{0}' already exists.", name));
18401835
return;
18411836
}
18421837

1843-
const resultUrl = await window.showInputBox({
1838+
const url = await window.showInputBox({
18441839
placeHolder: localize('remote url', "Remote URL"),
18451840
prompt: localize('provide remote URL', "Enter URL for remote \"{0}\"", name),
18461841
ignoreFocusOut: true
18471842
});
18481843

1849-
const url = sanitize(resultUrl || '');
1850-
18511844
if (!url) {
18521845
return;
18531846
}

0 commit comments

Comments
 (0)