File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ type GitlabDownloaderFactory struct {
33
33
}
34
34
35
35
// 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
36
37
func (f * GitlabDownloaderFactory ) Match (opts base.MigrateOptions ) (bool , error ) {
37
38
var matched bool
38
39
@@ -43,6 +44,9 @@ func (f *GitlabDownloaderFactory) Match(opts base.MigrateOptions) (bool, error)
43
44
if strings .EqualFold (u .Host , "gitlab.com" ) && opts .AuthUsername != "" {
44
45
matched = true
45
46
}
47
+ if strings .EqualFold (u .Fragment , "gitlab" ) && opts .AuthUsername != "" {
48
+ matched = true
49
+ }
46
50
47
51
return matched , nil
48
52
}
Original file line number Diff line number Diff line change @@ -1162,7 +1162,7 @@ function initMigration() {
1162
1162
const authUserName = $ ( '#auth_username' ) . val ( ) ;
1163
1163
const cloneAddr = $ ( '#clone_addr' ) . val ( ) ;
1164
1164
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' ) ) ) ) {
1166
1166
$ ( '#migrate_items' ) . show ( ) ;
1167
1167
} else {
1168
1168
$ ( '#migrate_items' ) . hide ( ) ;
@@ -2632,7 +2632,7 @@ $(document).ready(async () => {
2632
2632
$cloneAddr . on ( 'change' , ( ) => {
2633
2633
const $repoName = $ ( '#repo_name' ) ;
2634
2634
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 ] ) ;
2636
2636
}
2637
2637
} ) ;
2638
2638
You can’t perform that action at this time.
0 commit comments