From 60875f331419f64fcdca19f273909ab0b55824b1 Mon Sep 17 00:00:00 2001
From: Ramin Tadayon
Date: Tue, 4 Mar 2025 10:47:03 -0700
Subject: [PATCH 1/5] Adds merge detect actions & squash merge detect
---
src/constants.commands.ts | 2 +
src/env/node/git/sub-providers/branches.ts | 31 ++++++++++-
.../home/components/merge-target-status.ts | 52 +++++++++++++++++++
src/webviews/home/homeWebview.ts | 44 +++++++++++++++-
src/webviews/home/protocol.ts | 2 +
5 files changed, 128 insertions(+), 3 deletions(-)
diff --git a/src/constants.commands.ts b/src/constants.commands.ts
index 4b14aea516723..c24bbfd61bef7 100644
--- a/src/constants.commands.ts
+++ b/src/constants.commands.ts
@@ -148,6 +148,8 @@ type InternalGraphWebviewCommands =
| 'gitlens.graph.skipPausedOperation';
type InternalHomeWebviewCommands =
+ | 'gitlens.home.deleteBranchOrWorktree'
+ | 'gitlens.home.pushBranch'
| 'gitlens.home.openMergeTargetComparison'
| 'gitlens.home.openPullRequestChanges'
| 'gitlens.home.openPullRequestComparison'
diff --git a/src/env/node/git/sub-providers/branches.ts b/src/env/node/git/sub-providers/branches.ts
index 9c525c8e3c183..a6a980350fda8 100644
--- a/src/env/node/git/sub-providers/branches.ts
+++ b/src/env/node/git/sub-providers/branches.ts
@@ -420,12 +420,39 @@ export class BranchesGitSubProvider implements GitBranchesSubProvider {
} catch {}
// Cherry-pick detection (handles cherry-picks, rebases, etc)
- const data = await this.git.exec({ cwd: repoPath }, 'cherry', '--abbrev', '-v', into.name, branch.name);
+ let data = await this.git.exec({ cwd: repoPath }, 'cherry', '--abbrev', '-v', into.name, branch.name);
// Check if there are no lines or all lines startwith a `-` (i.e. likely merged)
- if (!data || data.split('\n').every(l => l.startsWith('-'))) {
+ if (
+ !data ||
+ data
+ .trim()
+ .split('\n')
+ .every(l => l.startsWith('-'))
+ ) {
return { merged: true, confidence: 'high' };
}
+ // Attempt to detect squash merges by checking if the diff of the branch can be cleanly removed from the target
+ const mergeBase = await this.getMergeBase(repoPath, into.name, branch.name);
+ data = await this.git.exec({ cwd: repoPath }, 'diff', mergeBase, branch.name);
+ if (data?.length) {
+ // Create a temporary index file
+ await using disposableIndex = await this.provider.staging!.createTemporaryIndex(repoPath, into.name);
+ const { env } = disposableIndex;
+
+ data = await this.git.exec(
+ { cwd: repoPath, env: env, stdin: data },
+ 'apply',
+ '--cached',
+ '--reverse',
+ '--check',
+ '-',
+ );
+ if (!data?.trim().length) {
+ return { merged: true, confidence: 'medium' };
+ }
+ }
+
return { merged: false };
} catch (ex) {
Logger.error(ex, scope);
diff --git a/src/webviews/apps/plus/home/components/merge-target-status.ts b/src/webviews/apps/plus/home/components/merge-target-status.ts
index 0dd42db16ee60..8a311455fe554 100644
--- a/src/webviews/apps/plus/home/components/merge-target-status.ts
+++ b/src/webviews/apps/plus/home/components/merge-target-status.ts
@@ -285,6 +285,23 @@ export class GlMergeTargetStatus extends LitElement {
private renderContent() {
const target = renderBranchName(this.target?.name);
+ const mergeTargetRef =
+ this.mergedStatus?.merged && this.mergedStatus.localBranchOnly
+ ? {
+ repoPath: this.branch.repoPath,
+ branchId: this.mergedStatus.localBranchOnly.id!,
+ branchName: this.mergedStatus.localBranchOnly.name,
+ branchUpstreamName: this.mergedStatus.localBranchOnly.upstream?.name,
+ }
+ : this.target
+ ? {
+ repoPath: this.target.repoPath,
+ branchId: this.target.id,
+ branchName: this.target.name,
+ branchUpstreamName: undefined,
+ }
+ : undefined;
+
if (this.mergedStatus?.merged) {
if (this.mergedStatus.localBranchOnly) {
return html``;
}
@@ -318,6 +358,18 @@ export class GlMergeTargetStatus extends LitElement {
${this.mergedStatus.confidence !== 'highest' ? 'likely ' : ''}been merged into its merge target
${target}.
+
+ Delete
+ ${this.branch.worktree != null && !this.branch.worktree.isDefault ? 'Worktree' : 'Branch'}
+ ${renderBranchName(this.branch.name, this.branch.worktree != null)}
+
`;
}
diff --git a/src/webviews/home/homeWebview.ts b/src/webviews/home/homeWebview.ts
index 2ef3336780db9..07f6c46e65bbc 100644
--- a/src/webviews/home/homeWebview.ts
+++ b/src/webviews/home/homeWebview.ts
@@ -35,6 +35,7 @@ import { getBranchTargetInfo } from '../../git/utils/-webview/branch.utils';
import { getReferenceFromBranch } from '../../git/utils/-webview/reference.utils';
import { sortBranches } from '../../git/utils/-webview/sorting';
import { getOpenedWorktreesByBranch, groupWorktreesByBranch } from '../../git/utils/-webview/worktree.utils';
+import { getBranchNameWithoutRemote } from '../../git/utils/branch.utils';
import { getComparisonRefsForPullRequest } from '../../git/utils/pullRequest.utils';
import { createRevisionRange } from '../../git/utils/revision.utils';
import type { AIModelChangeEvent } from '../../plus/ai/aiProviderService';
@@ -318,6 +319,8 @@ export class HomeWebviewProvider implements WebviewProvider this.container.subscription.validate({ force: true }, src),
this,
),
+ registerCommand('gitlens.home.deleteBranchOrWorktree', this.deleteBranchOrWorktree, this),
+ registerCommand('gitlens.home.pushBranch', this.pushBranch, this),
registerCommand('gitlens.home.openMergeTargetComparison', this.mergeTargetCompare, this),
registerCommand('gitlens.home.openPullRequestChanges', this.pullRequestChanges, this),
registerCommand('gitlens.home.openPullRequestComparison', this.pullRequestCompare, this),
@@ -1167,6 +1170,45 @@ export class HomeWebviewProvider implements WebviewProvider b.id === ref.branchId);
+ if (branch == null) return;
+ if (branch.current && mergeTarget != null) {
+ if (mergeTarget != null) {
+ const mergeTargetLocalBranch = getBranchNameWithoutRemote(mergeTarget.branchName);
+ await this.container.git.checkout(ref.repoPath, mergeTargetLocalBranch);
+ }
+ }
+
+ void executeGitCommand({
+ command: 'branch',
+ state: {
+ subcommand: 'delete',
+ repo: ref.repoPath,
+ references: branch,
+ },
+ });
+ }
+
+ private pushBranch(ref: BranchRef) {
+ void this.container.git.push(ref.repoPath, {
+ reference: {
+ name: ref.branchName,
+ ref: ref.branchId,
+ refType: 'branch',
+ remote: false,
+ repoPath: ref.repoPath,
+ upstream: ref.branchUpstreamName
+ ? {
+ name: ref.branchUpstreamName,
+ missing: false,
+ }
+ : undefined,
+ },
+ });
+ }
+
private mergeTargetCompare(ref: BranchAndTargetRefs) {
return this.container.views.searchAndCompare.compare(ref.repoPath, ref.branchName, ref.mergeTargetName);
}
@@ -1401,7 +1443,7 @@ function getOverviewBranchesCore(
timestamp: timestamp,
status: branch.status,
upstream: branch.upstream,
- worktree: wt ? { name: wt.name, uri: wt.uri.toString() } : undefined,
+ worktree: wt ? { name: wt.name, uri: wt.uri.toString(), isDefault: wt.isDefault } : undefined,
});
}
diff --git a/src/webviews/home/protocol.ts b/src/webviews/home/protocol.ts
index ce5a8a03dc992..1b90532733012 100644
--- a/src/webviews/home/protocol.ts
+++ b/src/webviews/home/protocol.ts
@@ -181,6 +181,7 @@ export interface GetOverviewBranch {
worktree?: {
name: string;
uri: string;
+ isDefault: boolean;
};
}
@@ -320,6 +321,7 @@ export interface BranchRef {
repoPath: string;
branchId: string;
branchName: string;
+ branchUpstreamName?: string;
}
export interface BranchAndTargetRefs extends BranchRef {
From fb7bd0bf9e9157550a4c948cab5313400c52308b Mon Sep 17 00:00:00 2001
From: Ramin Tadayon
Date: Tue, 4 Mar 2025 11:26:38 -0700
Subject: [PATCH 2/5] Covers other delete branch cases
---
src/commands/git/switch.ts | 18 ++---
src/commands/git/worktree.ts | 24 +++---
src/plus/launchpad/launchpad.ts | 4 +-
src/plus/launchpad/launchpadProvider.ts | 4 +-
src/uris/deepLinks/deepLink.ts | 9 +++
src/uris/deepLinks/deepLinkService.ts | 50 ++++++++++++-
src/views/viewCommands.ts | 2 +-
.../apps/plus/home/components/branch-card.ts | 3 +
.../home/components/merge-target-status.ts | 3 +
src/webviews/home/homeWebview.ts | 73 +++++++++++++++----
src/webviews/home/protocol.ts | 4 +
src/webviews/plus/graph/graphWebview.ts | 2 +-
12 files changed, 155 insertions(+), 41 deletions(-)
diff --git a/src/commands/git/switch.ts b/src/commands/git/switch.ts
index 8c4374da035c5..79e487d68f428 100644
--- a/src/commands/git/switch.ts
+++ b/src/commands/git/switch.ts
@@ -38,7 +38,7 @@ interface State {
reference: GitReference;
createBranch?: string;
fastForwardTo?: GitReference;
- skipWorktreeConfirmations?: boolean;
+ worktreeDefaultOpen?: 'new' | 'current';
}
type ConfirmationChoice =
@@ -223,7 +223,7 @@ export class SwitchGitCommand extends QuickCommand {
openOnly: true,
overrides: {
disallowBack: true,
- confirmation: state.skipWorktreeConfirmations
+ confirmation: state.worktreeDefaultOpen
? undefined
: {
title: `Confirm Switch to Worktree \u2022 ${getReferenceLabel(
@@ -241,12 +241,12 @@ export class SwitchGitCommand extends QuickCommand {
},
onWorkspaceChanging: state.onWorkspaceChanging,
repo: state.repos[0],
- skipWorktreeConfirmations: state.skipWorktreeConfirmations,
+ worktreeDefaultOpen: state.worktreeDefaultOpen,
},
},
this.pickedVia,
);
- if (worktreeResult === StepResultBreak && !state.skipWorktreeConfirmations) continue;
+ if (worktreeResult === StepResultBreak && !state.worktreeDefaultOpen) continue;
endSteps(state);
return;
@@ -263,7 +263,7 @@ export class SwitchGitCommand extends QuickCommand {
state.createBranch = undefined;
context.promptToCreateBranch = false;
- if (state.skipWorktreeConfirmations) {
+ if (state.worktreeDefaultOpen) {
state.reference = context.canSwitchToLocalBranch;
continue outer;
}
@@ -273,7 +273,7 @@ export class SwitchGitCommand extends QuickCommand {
}
if (
- state.skipWorktreeConfirmations ||
+ state.worktreeDefaultOpen ||
this.confirm(context.promptToCreateBranch || context.canSwitchToLocalBranch ? true : state.confirm)
) {
const result = yield* this.confirmStep(state as SwitchStepState, context);
@@ -330,12 +330,12 @@ export class SwitchGitCommand extends QuickCommand {
result === 'switchToNewBranchViaWorktree' ? state.createBranch : undefined,
repo: state.repos[0],
onWorkspaceChanging: state.onWorkspaceChanging,
- skipWorktreeConfirmations: state.skipWorktreeConfirmations,
+ worktreeDefaultOpen: state.worktreeDefaultOpen,
},
},
this.pickedVia,
);
- if (worktreeResult === StepResultBreak && !state.skipWorktreeConfirmations) continue outer;
+ if (worktreeResult === StepResultBreak && !state.worktreeDefaultOpen) continue outer;
endSteps(state);
return;
@@ -355,7 +355,7 @@ export class SwitchGitCommand extends QuickCommand {
const isRemoteBranch = isBranchReference(state.reference) && state.reference.remote;
type StepType = QuickPickItemOfT;
- if (state.skipWorktreeConfirmations && state.repos.length === 1) {
+ if (state.worktreeDefaultOpen && state.repos.length === 1) {
if (isLocalBranch) {
return 'switchViaWorktree';
} else if (!state.createBranch && context.canSwitchToLocalBranch != null) {
diff --git a/src/commands/git/worktree.ts b/src/commands/git/worktree.ts
index e9fc71b3b37ee..fbd12cc9d2873 100644
--- a/src/commands/git/worktree.ts
+++ b/src/commands/git/worktree.ts
@@ -103,7 +103,7 @@ interface CreateState {
};
onWorkspaceChanging?: ((isNewWorktree?: boolean) => Promise) | ((isNewWorktree?: boolean) => void);
- skipWorktreeConfirmations?: boolean;
+ worktreeDefaultOpen?: 'new' | 'current';
}
type DeleteFlags = '--force' | '--delete-branches';
@@ -141,7 +141,7 @@ interface OpenState {
onWorkspaceChanging?: ((isNewWorktree?: boolean) => Promise) | ((isNewWorktree?: boolean) => void);
isNewWorktree?: boolean;
- skipWorktreeConfirmations?: boolean;
+ worktreeDefaultOpen?: 'new' | 'current';
}
interface CopyChangesState {
@@ -632,7 +632,7 @@ export class WorktreeGitCommand extends QuickCommand {
openOnly: true,
overrides: { disallowBack: true },
isNewWorktree: true,
- skipWorktreeConfirmations: state.skipWorktreeConfirmations,
+ worktreeDefaultOpen: state.worktreeDefaultOpen,
onWorkspaceChanging: state.onWorkspaceChanging,
} satisfies OpenStepState,
context,
@@ -739,7 +739,7 @@ export class WorktreeGitCommand extends QuickCommand {
const confirmations: StepType[] = [];
if (!createDirectlyInFolder) {
- if (state.skipWorktreeConfirmations) {
+ if (state.worktreeDefaultOpen) {
return [defaultOption.context, defaultOption.item];
}
@@ -1101,15 +1101,21 @@ export class WorktreeGitCommand extends QuickCommand {
detail: 'Will open the worktree in a new window',
});
- if (state.skipWorktreeConfirmations) {
+ const currentWindowItem = createFlagsQuickPickItem(state.flags, [], {
+ label: 'Open Worktree',
+ detail: 'Will open the worktree in the current window',
+ });
+
+ if (state.worktreeDefaultOpen === 'new') {
return newWindowItem.item;
}
+ if (state.worktreeDefaultOpen === 'current') {
+ return currentWindowItem.item;
+ }
+
const confirmations: StepType[] = [
- createFlagsQuickPickItem(state.flags, [], {
- label: 'Open Worktree',
- detail: 'Will open the worktree in the current window',
- }),
+ currentWindowItem,
newWindowItem,
createFlagsQuickPickItem(state.flags, ['--add-to-workspace'], {
label: `Add Worktree to Workspace`,
diff --git a/src/plus/launchpad/launchpad.ts b/src/plus/launchpad/launchpad.ts
index 58af70ff2b233..b7d7f824f0745 100644
--- a/src/plus/launchpad/launchpad.ts
+++ b/src/plus/launchpad/launchpad.ts
@@ -391,7 +391,7 @@ export class LaunchpadCommand extends QuickCommand {
void this.container.launchpad.switchTo(state.item);
break;
case 'open-worktree':
- void this.container.launchpad.switchTo(state.item, { skipWorktreeConfirmations: true });
+ void this.container.launchpad.switchTo(state.item, { openInWorktree: true });
break;
case 'switch-and-code-suggest':
case 'code-suggest':
@@ -900,7 +900,7 @@ export class LaunchpadCommand extends QuickCommand {
case OpenWorktreeInNewWindowQuickInputButton:
this.sendItemActionTelemetry('open-worktree', item, group, context);
- await this.container.launchpad.switchTo(item, { skipWorktreeConfirmations: true });
+ await this.container.launchpad.switchTo(item, { openInWorktree: true });
break;
}
diff --git a/src/plus/launchpad/launchpadProvider.ts b/src/plus/launchpad/launchpadProvider.ts
index 3dd752cec9846..0235f8c54b194 100644
--- a/src/plus/launchpad/launchpadProvider.ts
+++ b/src/plus/launchpad/launchpadProvider.ts
@@ -467,7 +467,7 @@ export class LaunchpadProvider implements Disposable {
@log({ args: { 0: i => `${i.id} (${i.provider.name} ${i.type})` } })
async switchTo(
item: LaunchpadItem,
- options?: { skipWorktreeConfirmations?: boolean; startCodeSuggestion?: boolean },
+ options?: { openInWorktree?: boolean; startCodeSuggestion?: boolean },
): Promise {
if (item.openRepository?.localBranch?.current) {
void showInspectView({
@@ -483,7 +483,7 @@ export class LaunchpadProvider implements Disposable {
item,
options?.startCodeSuggestion
? DeepLinkActionType.SwitchToAndSuggestPullRequest
- : options?.skipWorktreeConfirmations
+ : options?.openInWorktree
? DeepLinkActionType.SwitchToPullRequestWorktree
: DeepLinkActionType.SwitchToPullRequest,
);
diff --git a/src/uris/deepLinks/deepLink.ts b/src/uris/deepLinks/deepLink.ts
index c3ac5b7a85d2f..7e3a16093bbaf 100644
--- a/src/uris/deepLinks/deepLink.ts
+++ b/src/uris/deepLinks/deepLink.ts
@@ -45,6 +45,7 @@ export const DeepLinkCommandTypeToCommand = new Map b.id === ref.branchId);
+ const worktree = branch ? repo?.worktreesByBranch.get(branch.id) : undefined;
if (branch == null) return;
- if (branch.current && mergeTarget != null) {
- if (mergeTarget != null) {
- const mergeTargetLocalBranch = getBranchNameWithoutRemote(mergeTarget.branchName);
- await this.container.git.checkout(ref.repoPath, mergeTargetLocalBranch);
- }
- }
+ if (branch.current && mergeTarget != null && (!worktree || worktree.isDefault)) {
+ const mergeTargetLocalBranchName = getBranchNameWithoutRemote(mergeTarget.branchName);
+ const confirm = await window.showWarningMessage(
+ `The merge target branch ${mergeTargetLocalBranchName} will be checked out before deleting the current branch ${branch.name}.`,
+ { title: 'Proceed' },
+ { title: 'Cancel' },
+ );
- void executeGitCommand({
- command: 'branch',
- state: {
- subcommand: 'delete',
- repo: ref.repoPath,
- references: branch,
- },
- });
+ if (confirm == null || confirm.title !== 'Proceed') return;
+ await this.container.git.checkout(ref.repoPath, mergeTargetLocalBranchName);
+
+ void executeGitCommand({
+ command: 'branch',
+ state: {
+ subcommand: 'delete',
+ repo: ref.repoPath,
+ references: branch,
+ },
+ });
+ } else if (repo != null && branch != null && worktree != null && !worktree.isDefault) {
+ const defaultWorktree = [...repo.worktreesByBranch.values()].find(w => w.isDefault);
+ if (defaultWorktree == null) return;
+
+ const confirm = await window.showWarningMessage(
+ `You will be returned to the default worktree before deleting the worktree for ${branch.name}.`,
+ { title: 'Proceed' },
+ { title: 'Cancel' },
+ );
+
+ if (confirm == null || confirm.title !== 'Proceed') return;
+ const schemeOverride = configuration.get('deepLinks.schemeOverride');
+ const scheme = typeof schemeOverride === 'string' ? schemeOverride : env.uriScheme;
+ const deleteBranchDeepLink = {
+ url: `${scheme}://${this.container.context.extension.id}/${'link' satisfies UriTypes}/${
+ DeepLinkType.Repository
+ }/-/${DeepLinkType.Branch}/${encodeURIComponent(branch.name)}?path=${encodeURIComponent(
+ branch.repoPath,
+ )}&action=delete-branch`,
+ repoPath: branch.repoPath,
+ useProgress: false,
+ state: DeepLinkServiceState.GoToTarget,
+ };
+
+ void executeGitCommand({
+ command: 'worktree',
+ state: {
+ subcommand: 'open',
+ repo: defaultWorktree.repoPath,
+ worktree: defaultWorktree,
+ onWorkspaceChanging: async (_isNewWorktree?: boolean) =>
+ this.container.storage.store('deepLinks:pending', deleteBranchDeepLink),
+ worktreeDefaultOpen: 'current',
+ },
+ });
+ }
}
private pushBranch(ref: BranchRef) {
diff --git a/src/webviews/home/protocol.ts b/src/webviews/home/protocol.ts
index 1b90532733012..0106b72bf03d7 100644
--- a/src/webviews/home/protocol.ts
+++ b/src/webviews/home/protocol.ts
@@ -322,6 +322,10 @@ export interface BranchRef {
branchId: string;
branchName: string;
branchUpstreamName?: string;
+ worktree?: {
+ name: string;
+ isDefault: boolean;
+ };
}
export interface BranchAndTargetRefs extends BranchRef {
diff --git a/src/webviews/plus/graph/graphWebview.ts b/src/webviews/plus/graph/graphWebview.ts
index 20d33a16d2812..96ba2ac0d7499 100644
--- a/src/webviews/plus/graph/graphWebview.ts
+++ b/src/webviews/plus/graph/graphWebview.ts
@@ -3891,7 +3891,7 @@ export class GraphWebviewProvider implements WebviewProvider
Date: Wed, 5 Mar 2025 12:10:50 -0700
Subject: [PATCH 3/5] Fixes wrong repo path on branch delete
---
src/webviews/home/homeWebview.ts | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/webviews/home/homeWebview.ts b/src/webviews/home/homeWebview.ts
index f48f08a660f4d..746c21c42220e 100644
--- a/src/webviews/home/homeWebview.ts
+++ b/src/webviews/home/homeWebview.ts
@@ -1181,8 +1181,8 @@ export class HomeWebviewProvider implements WebviewProvider w.isDefault);
- if (defaultWorktree == null) return;
+ if (defaultWorktree == null || commonRepo == null) return;
const confirm = await window.showWarningMessage(
`You will be returned to the default worktree before deleting the worktree for ${branch.name}.`,
+ { modal: true },
{ title: 'Proceed' },
- { title: 'Cancel' },
);
if (confirm == null || confirm.title !== 'Proceed') return;
@@ -1213,9 +1214,9 @@ export class HomeWebviewProvider implements WebviewProvider
Date: Tue, 11 Mar 2025 10:33:42 -0700
Subject: [PATCH 4/5] Updates wording and fetches branch if not in list
---
src/webviews/home/homeWebview.ts | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/src/webviews/home/homeWebview.ts b/src/webviews/home/homeWebview.ts
index 746c21c42220e..13440ab7533d7 100644
--- a/src/webviews/home/homeWebview.ts
+++ b/src/webviews/home/homeWebview.ts
@@ -1174,18 +1174,24 @@ export class HomeWebviewProvider implements WebviewProvider b.id === ref.branchId);
+ let branch = repo?.branches.find(b => b.id === ref.branchId);
+ if (branch == null) {
+ branch = await repo?.repo.git.branches().getBranch(ref.branchId);
+ }
+
const worktree = branch ? repo?.worktreesByBranch.get(branch.id) : undefined;
if (branch == null) return;
+
if (branch.current && mergeTarget != null && (!worktree || worktree.isDefault)) {
const mergeTargetLocalBranchName = getBranchNameWithoutRemote(mergeTarget.branchName);
const confirm = await window.showWarningMessage(
- `The merge target branch ${mergeTargetLocalBranchName} will be checked out before deleting the current branch ${branch.name}.`,
+ `Before deleting the current branch '${branch.name}', you will be switched to '${mergeTargetLocalBranchName}'.`,
{ modal: true },
- { title: 'Proceed' },
+ { title: 'Continue' },
);
- if (confirm == null || confirm.title !== 'Proceed') return;
+ if (confirm == null || confirm.title !== 'Continue') return;
+
await this.container.git.checkout(ref.repoPath, mergeTargetLocalBranchName);
void executeGitCommand({
@@ -1202,12 +1208,13 @@ export class HomeWebviewProvider implements WebviewProvider
Date: Tue, 11 Mar 2025 10:36:44 -0700
Subject: [PATCH 5/5] Updates fn call
---
src/env/node/git/sub-providers/branches.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/env/node/git/sub-providers/branches.ts b/src/env/node/git/sub-providers/branches.ts
index a6a980350fda8..137bd3cf8c9a3 100644
--- a/src/env/node/git/sub-providers/branches.ts
+++ b/src/env/node/git/sub-providers/branches.ts
@@ -433,7 +433,7 @@ export class BranchesGitSubProvider implements GitBranchesSubProvider {
}
// Attempt to detect squash merges by checking if the diff of the branch can be cleanly removed from the target
- const mergeBase = await this.getMergeBase(repoPath, into.name, branch.name);
+ const mergeBase = await this.provider.refs.getMergeBase(repoPath, into.name, branch.name);
data = await this.git.exec({ cwd: repoPath }, 'diff', mergeBase, branch.name);
if (data?.length) {
// Create a temporary index file