Skip to content

Commit 27899d2

Browse files
committed
Updates path lookup to GitDir when opening rebase editor
1 parent b474062 commit 27899d2

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/views/viewCommands.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -736,11 +736,14 @@ export class ViewCommands implements Disposable {
736736
}
737737

738738
@log()
739-
private openPausedOperationInRebaseEditor(node: PausedOperationStatusNode) {
740-
if (!node.is('paused-operation-status') || node.pausedOpStatus.type !== 'rebase') return Promise.resolve();
739+
private async openPausedOperationInRebaseEditor(node: PausedOperationStatusNode) {
740+
if (!node.is('paused-operation-status') || node.pausedOpStatus.type !== 'rebase') return;
741741

742-
const rebaseTodoUri = Uri.joinPath(node.uri, '.git', 'rebase-merge', 'git-rebase-todo');
743-
return executeCoreCommand('vscode.openWith', rebaseTodoUri, 'gitlens.rebase', {
742+
const gitDir = await this.container.git.getGitDir(node.repoPath);
743+
if (gitDir == null) return;
744+
745+
const rebaseTodoUri = Uri.joinPath(gitDir.uri, 'rebase-merge', 'git-rebase-todo');
746+
void executeCoreCommand('vscode.openWith', rebaseTodoUri, 'gitlens.rebase', {
744747
preview: false,
745748
});
746749
}

src/webviews/home/homeWebview.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -480,11 +480,11 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
480480
private async openRebaseEditor(pausedOpArgs: GitPausedOperationCommandArgs) {
481481
if (pausedOpArgs.operation.type !== 'rebase') return;
482482

483-
const repo = this._repositoryBranches.get(pausedOpArgs.operation.repoPath)?.repo;
484-
if (repo == null) return;
483+
const gitDir = await this.container.git.getGitDir(pausedOpArgs.operation.repoPath);
484+
if (gitDir == null) return;
485485

486-
const rebaseTodoUri = Uri.joinPath(repo.uri, '.git', 'rebase-merge', 'git-rebase-todo');
487-
await executeCoreCommand('vscode.openWith', rebaseTodoUri, 'gitlens.rebase', {
486+
const rebaseTodoUri = Uri.joinPath(gitDir.uri, 'rebase-merge', 'git-rebase-todo');
487+
void executeCoreCommand('vscode.openWith', rebaseTodoUri, 'gitlens.rebase', {
488488
preview: false,
489489
});
490490
}

0 commit comments

Comments
 (0)