mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-04-20 03:11:35 +02:00
Don't put trailing slash in autogenerated name during import
During import process, if I paste in the valid GitHub clone URL https://github.com/yuvipanda/notebooksharing.space/, the form automatically generates an invalid forgejo repo name including the trailing slash. This commit changes the regex used to generate this to optionally ignore the trailing slash - it was already ignoring the optional trailing `.git`.
This commit is contained in:
parent
8df8381f51
commit
f2a1dbf9cd
1 changed files with 1 additions and 1 deletions
|
@ -29,7 +29,7 @@ export function initRepoMigration() {
|
|||
cloneAddr?.addEventListener('change', () => {
|
||||
const repoName = document.getElementById('repo_name');
|
||||
if (cloneAddr.value && !repoName?.value) { // Only modify if repo_name input is blank
|
||||
repoName.value = cloneAddr.value.match(/^(.*\/)?((.+?)(\.git)?)$/)[3];
|
||||
repoName.value = cloneAddr.value.match(/^(.*\/)?((.+?)(\.git)?\/?)$/)[3];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue