diff --git a/src/browser.ts b/src/browser.ts index 5f1a52f..582b5e9 100644 --- a/src/browser.ts +++ b/src/browser.ts @@ -55,7 +55,7 @@ export class GitLabFileBrowser extends Widget { url, resource.repository, 'tree', - 'master', + this._drive.defaultBranch, resource.path ); } diff --git a/src/contents.ts b/src/contents.ts index b0ad9f9..ad74fe2 100644 --- a/src/contents.ts +++ b/src/contents.ts @@ -156,6 +156,13 @@ export class GitLabDrive implements Contents.IDrive { this._accessToken = token; } + /** + * The repository default branch + */ + get defaultBranch(): string { + return this._defaultBranch || 'main'; + } + /** * Get a file or directory. *