Skip to content

Commit 9a4ded7

Browse files
BeowulfR0ko
authored andcommitted
fix(ui): use correct branch name in branch tag selector (go-gitea#7575)
Regression from: https://codeberg.org/forgejo/forgejo/pulls/7571 Needed for: https://codeberg.org/forgejo/forgejo/pulls/7574 Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7575 Reviewed-by: 0ko <[email protected]> Co-authored-by: Beowulf <[email protected]> Co-committed-by: Beowulf <[email protected]>
1 parent 3f673ce commit 9a4ded7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

tests/e2e/repo-home.test.e2e.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ test('Branch selector commit icon', async ({page}) => {
2727
expect(response?.status()).toBe(200);
2828

2929
await expect(page.locator('.branch-dropdown-button svg.octicon-git-branch')).toBeVisible();
30+
await expect(page.locator('.branch-dropdown-button')).toHaveText('master');
3031

31-
await page.goto('/user2/repo1/src/commit/65f1bf27bc');
32+
await page.goto('/user2/repo1/src/commit/65f1bf27bc3bf70f64657658635e66094edbcb4d');
3233
await expect(page.locator('.branch-dropdown-button svg.octicon-git-commit')).toBeVisible();
34+
await expect(page.locator('.branch-dropdown-button')).toHaveText('65f1bf27bc');
3335
});

web_src/js/components/RepoBranchTagSelector.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const sfc = {
5656
this.refNameText = this.commitIdShort;
5757
} else if (this.viewType === 'branch') {
5858
this.isViewBranch = true;
59-
this.refNameText = this.viewType;
59+
this.refNameText = this.branchName;
6060
} else {
6161
this.isViewTag = true;
6262
this.refNameText = this.tagName;

0 commit comments

Comments
 (0)