mirror of
https://forgejo.stefka.eu/jiriks74/create-pull-request.git
synced 2025-01-18 16:01:06 +01:00
test: integration test fixes
This commit is contained in:
parent
d2781bf605
commit
e879d98c57
6 changed files with 76 additions and 30 deletions
12
dist/index.js
vendored
12
dist/index.js
vendored
|
@ -929,7 +929,6 @@ class GitConfigHelper {
|
|||
}
|
||||
static parseGitRemote(remoteUrl) {
|
||||
const httpsUrlPattern = new RegExp('^(https?)://(?:.+@)?(.+?)/(.+/.+?)(\\.git)?$', 'i');
|
||||
const sshUrlPattern = new RegExp('^git@(.+?):(.+/.+)\\.git$', 'i');
|
||||
const httpsMatch = remoteUrl.match(httpsUrlPattern);
|
||||
if (httpsMatch) {
|
||||
return {
|
||||
|
@ -938,6 +937,7 @@ class GitConfigHelper {
|
|||
repository: httpsMatch[3]
|
||||
};
|
||||
}
|
||||
const sshUrlPattern = new RegExp('^git@(.+?):(.+/.+)\\.git$', 'i');
|
||||
const sshMatch = remoteUrl.match(sshUrlPattern);
|
||||
if (sshMatch) {
|
||||
return {
|
||||
|
@ -946,6 +946,16 @@ class GitConfigHelper {
|
|||
repository: sshMatch[2]
|
||||
};
|
||||
}
|
||||
// Unauthenticated git protocol for integration tests only
|
||||
const gitUrlPattern = new RegExp('^git://(.+?)/(.+/.+)\\.git$', 'i');
|
||||
const gitMatch = remoteUrl.match(gitUrlPattern);
|
||||
if (gitMatch) {
|
||||
return {
|
||||
hostname: gitMatch[1],
|
||||
protocol: 'GIT',
|
||||
repository: gitMatch[2]
|
||||
};
|
||||
}
|
||||
throw new Error(`The format of '${remoteUrl}' is not a valid GitHub repository URL`);
|
||||
}
|
||||
savePersistedAuth() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue