Fix azure devops urls

- manually tested
This commit is contained in:
Mattias Granlund 2024-07-28 22:33:05 +01:00
parent e8e377a303
commit dc87e5fd64
3 changed files with 9 additions and 8 deletions

View File

@ -11,22 +11,22 @@ export const AZURE_DOMAIN = 'dev.azure.com';
* https://github.com/gitbutlerapp/gitbutler/issues/2651
*/
export class AzureDevOps implements GitHost {
webUrl: string;
url: string;
constructor(
repo: RepoInfo,
private baseBranch: string,
private fork?: string
) {
this.webUrl = `https://${AZURE_DOMAIN}/${repo.owner}/${repo.name}`;
this.url = `https://${AZURE_DOMAIN}/${repo.organization}/${repo.owner}/_git/${repo.name}`;
}
branch(name: string) {
return new AzureBranch(name, this.baseBranch, this.webUrl, this.fork);
return new AzureBranch(name, this.baseBranch, this.url, this.fork);
}
commitUrl(id: string): string {
return `${this.webUrl}/commit/${id}`;
return `${this.url}/commit/${id}`;
}
listService() {

View File

@ -6,7 +6,6 @@ export class AzureBranch implements GitHostBranch {
if (fork) {
name = `${fork}:${name}`;
}
this.url = `${baseUrl}/compare/${baseBranch}...${name}`;
`${baseUrl}/branchCompare?baseVersion=GB${baseBranch}&targetVersion=GB${name}`;
this.url = `${baseUrl}/branchCompare?baseVersion=GB${baseBranch}&targetVersion=GB${name}`;
}
}

View File

@ -4,13 +4,15 @@ export type RepoInfo = {
source: string;
name: string;
owner: string;
organization?: string;
};
export function parseRemoteUrl(url: string): RepoInfo {
const { source, name, owner } = gitUrlParse(url);
const { source, name, owner, organization } = gitUrlParse(url);
return {
source,
name,
owner
owner,
organization
};
}