Skip to content

Commit 8f6bace

Browse files
Fetch correct default branch in toolbar (#24)
Signed-off-by: Mahendra Paipuri <[email protected]>
1 parent 5305b42 commit 8f6bace

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/browser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class GitLabFileBrowser extends Widget {
5555
url,
5656
resource.repository,
5757
'tree',
58-
'master',
58+
this._drive.defaultBranch,
5959
resource.path
6060
);
6161
}

src/contents.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,13 @@ export class GitLabDrive implements Contents.IDrive {
156156
this._accessToken = token;
157157
}
158158

159+
/**
160+
* The repository default branch
161+
*/
162+
get defaultBranch(): string {
163+
return this._defaultBranch || 'main';
164+
}
165+
159166
/**
160167
* Get a file or directory.
161168
*

0 commit comments

Comments
 (0)