Skip to content

Commit 9b90b30

Browse files
Travis Collinseamodio
authored andcommitted
Fixes #1303: Fix remote URLs for Azure DevOps
1 parent e77280e commit 9b90b30

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/git/remotes/azure-devops.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ export class AzureDevOpsRemote extends RemoteProvider {
3535
}
3636
}
3737

38+
// Azure DevOps allows projects and repository names with spaces. In that situation,
39+
// the `path` will be previously encoded during git clone
40+
// revert that encoding to avoid double-encoding by gitlens during copy remote and open remote
41+
path = decodeURIComponent(path);
3842
super(domain, path, protocol, name);
3943
}
4044

@@ -131,8 +135,8 @@ export class AzureDevOpsRemote extends RemoteProvider {
131135
line = '';
132136
}
133137

134-
if (sha) return `${this.baseUrl}/commit/${sha}/?_a=contents&path=%2F${fileName}${line}`;
135-
if (branch) return `${this.baseUrl}/?path=%2F${fileName}&version=GB${branch}&_a=contents${line}`;
136-
return `${this.baseUrl}?path=%2F${fileName}${line}`;
138+
if (sha) return `${this.baseUrl}/commit/${sha}/?_a=contents&path=/${fileName}${line}`;
139+
if (branch) return `${this.baseUrl}/?path=/${fileName}&version=GB${branch}&_a=contents${line}`;
140+
return `${this.baseUrl}?path=/${fileName}${line}`;
137141
}
138142
}

0 commit comments

Comments
 (0)