mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-24 18:12:48 +03:00
Fix azure devops urls
- manually tested
This commit is contained in:
parent
e8e377a303
commit
dc87e5fd64
@ -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() {
|
||||
|
@ -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}`;
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user