Fix conflicting-branches list message

- Currently no branches are listed
- The branches list returned by update_base_branch contains string, whereas when the message is constructed it's assumed the objects in the list have a 'name' property
This commit is contained in:
Comnir 2024-08-23 16:15:27 +03:00
parent ca62ac8893
commit ca8bf2e400

View File

@ -4,7 +4,6 @@ import * as toasts from '$lib/utils/toasts';
import posthog from 'posthog-js';
import type { BaseBranchService } from '$lib/baseBranch/baseBranchService';
import type { RemoteBranchService } from '$lib/stores/remoteBranches';
import type { VirtualBranch, Hunk, LocalFile } from './types';
import type { VirtualBranchService } from './virtualBranch';
export class BranchController {
@ -257,12 +256,13 @@ export class BranchController {
async updateBaseBranch(): Promise<string | undefined> {
try {
const stashedConflicting = await invoke<VirtualBranch[]>('update_base_branch', {
const stashedConflicting = await invoke<string[]>('update_base_branch', {
projectId: this.projectId
});
const branchRefPrefix = 'refs/heads/';
if (stashedConflicting.length > 0) {
return `The following branches were stashed due to a merge conflict during updating the workspace: \n\n \
${stashedConflicting.map((branch) => branch.name).join('\n')} \n\n \
${stashedConflicting.map((branch) => branch.split(branchRefPrefix)[1]).join('\n')} \n\n \
You can find them in the 'Branches' sidebar in order to resolve conflicts.`;
} else {
return undefined;