File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ type GitlabDownloaderFactory struct {
3333}
3434
3535// Match returns ture if the migration remote URL matched this downloader factory
36+ // To allow self-hosting Gitlab instances, this matches based on the Host or a '#gitlab' fragment
3637func (f * GitlabDownloaderFactory ) Match (opts base.MigrateOptions ) (bool , error ) {
3738 var matched bool
3839
@@ -43,6 +44,9 @@ func (f *GitlabDownloaderFactory) Match(opts base.MigrateOptions) (bool, error)
4344 if strings .EqualFold (u .Host , "gitlab.com" ) && opts .AuthUsername != "" {
4445 matched = true
4546 }
47+ if strings .EqualFold (u .Fragment , "gitlab" ) && opts .AuthUsername != "" {
48+ matched = true
49+ }
4650
4751 return matched , nil
4852}
Original file line number Diff line number Diff line change @@ -1162,7 +1162,7 @@ function initMigration() {
11621162 const authUserName = $ ( '#auth_username' ) . val ( ) ;
11631163 const cloneAddr = $ ( '#clone_addr' ) . val ( ) ;
11641164 if ( ! $ ( '#mirror' ) . is ( ':checked' ) && ( authUserName && authUserName . length > 0 ) &&
1165- ( cloneAddr !== undefined && ( cloneAddr . startsWith ( 'https://github.com' ) || cloneAddr . startsWith ( 'http://github.com' ) || cloneAddr . startsWith ( 'http://gitlab.com' ) || cloneAddr . startsWith ( 'https://gitlab.com' ) ) ) ) {
1165+ ( cloneAddr !== undefined && ( cloneAddr . startsWith ( 'https://github.com' ) || cloneAddr . startsWith ( 'http://github.com' ) || cloneAddr . startsWith ( 'http://gitlab.com' ) || cloneAddr . startsWith ( 'https://gitlab.com' ) || cloneAddr . endsWith ( '#gitlab' ) ) ) ) {
11661166 $ ( '#migrate_items' ) . show ( ) ;
11671167 } else {
11681168 $ ( '#migrate_items' ) . hide ( ) ;
@@ -2632,7 +2632,7 @@ $(document).ready(async () => {
26322632 $cloneAddr . on ( 'change' , ( ) => {
26332633 const $repoName = $ ( '#repo_name' ) ;
26342634 if ( $cloneAddr . val ( ) . length > 0 && $repoName . val ( ) . length === 0 ) { // Only modify if repo_name input is blank
2635- $repoName . val ( $cloneAddr . val ( ) . match ( / ^ ( .* \/ ) ? ( ( .+ ?) ( \. g i t ) ? ) $ / ) [ 3 ] ) ;
2635+ $repoName . val ( $cloneAddr . val ( ) . match ( / ^ ( .* \/ ) ? ( ( .+ ?) ( \. g i t ) ? ( # g i t l a b ? ) ) $ / ) [ 3 ] ) ;
26362636 }
26372637 } ) ;
26382638
You can’t perform that action at this time.
0 commit comments