feat: add source control action to abort merge (#2092)
Co-authored-by: Orca <help@stably.ai> Co-authored-by: brennanb2025 <brennankbenson@gmail.com>
This commit is contained in:
co-authored by
Orca
brennanb2025
parent
a65f7b4216
commit
659fe79226
@@ -61,6 +61,7 @@ export class GitHandler {
|
||||
this.dispatcher.onRequest('git.unstage', (p) => this.unstage(p))
|
||||
this.dispatcher.onRequest('git.bulkStage', (p) => this.bulkStage(p))
|
||||
this.dispatcher.onRequest('git.bulkUnstage', (p) => this.bulkUnstage(p))
|
||||
this.dispatcher.onRequest('git.abortMerge', (p) => this.abortMerge(p))
|
||||
this.dispatcher.onRequest('git.discard', (p) => this.discard(p))
|
||||
this.dispatcher.onRequest('git.bulkDiscard', (p) => this.bulkDiscard(p))
|
||||
this.dispatcher.onRequest('git.conflictOperation', (p) => this.conflictOperation(p))
|
||||
@@ -183,6 +184,11 @@ export class GitHandler {
|
||||
}
|
||||
}
|
||||
|
||||
private async abortMerge(params: Record<string, unknown>) {
|
||||
const worktreePath = params.worktreePath as string
|
||||
await this.git(['merge', '--abort'], worktreePath)
|
||||
}
|
||||
|
||||
private normalizeGitPathForCompare(filePath: string): string {
|
||||
return filePath.replace(/\\/g, '/').replace(/\/+$/, '')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user