|
1 | 1 | import type { ConfigurationChangeEvent } from 'vscode'; |
2 | | -import { Disposable, Uri, workspace } from 'vscode'; |
| 2 | +import { Disposable, Uri, window, workspace } from 'vscode'; |
3 | 3 | import type { CreatePullRequestActionContext } from '../../api/gitlens'; |
4 | 4 | import type { EnrichedAutolink } from '../../autolinks'; |
5 | 5 | import { getAvatarUriFromGravatarEmail } from '../../avatars'; |
@@ -474,18 +474,42 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe |
474 | 474 | } |
475 | 475 |
|
476 | 476 | private async abortPausedOperation(pausedOpArgs: GitPausedOperationCommandArgs) { |
477 | | - await this.container.git.status(pausedOpArgs.operation.repoPath).abortPausedOperation?.(); |
| 477 | + const abortPausedOperation = this.container.git.status(pausedOpArgs.operation.repoPath).abortPausedOperation; |
| 478 | + if (abortPausedOperation == null) return; |
| 479 | + |
| 480 | + try { |
| 481 | + await abortPausedOperation(); |
| 482 | + } catch (ex) { |
| 483 | + void window.showErrorMessage(ex.message); |
| 484 | + } |
478 | 485 | } |
479 | 486 |
|
480 | 487 | private async continuePausedOperation(pausedOpArgs: GitPausedOperationCommandArgs) { |
481 | 488 | if (pausedOpArgs.operation.type === 'revert') return; |
482 | | - await this.container.git.status(pausedOpArgs.operation.repoPath).continuePausedOperation?.(); |
| 489 | + |
| 490 | + const continuePausedOperation = this.container.git.status( |
| 491 | + pausedOpArgs.operation.repoPath, |
| 492 | + ).continuePausedOperation; |
| 493 | + if (continuePausedOperation == null) return; |
| 494 | + |
| 495 | + try { |
| 496 | + await continuePausedOperation(); |
| 497 | + } catch (ex) { |
| 498 | + void window.showErrorMessage(ex.message); |
| 499 | + } |
483 | 500 | } |
484 | 501 |
|
485 | 502 | private async skipPausedOperation(pausedOpArgs: GitPausedOperationCommandArgs) { |
486 | | - if (pausedOpArgs.operation.type === 'merge') return; |
487 | | - |
488 | | - await this.container.git.status(pausedOpArgs.operation.repoPath).continuePausedOperation?.({ skip: true }); |
| 503 | + const continuePausedOperation = this.container.git.status( |
| 504 | + pausedOpArgs.operation.repoPath, |
| 505 | + ).continuePausedOperation; |
| 506 | + if (continuePausedOperation == null) return; |
| 507 | + |
| 508 | + try { |
| 509 | + await continuePausedOperation({ skip: true }); |
| 510 | + } catch (ex) { |
| 511 | + void window.showErrorMessage(ex.message); |
| 512 | + } |
489 | 513 | } |
490 | 514 |
|
491 | 515 | private async openRebaseEditor(pausedOpArgs: GitPausedOperationCommandArgs) { |
|
0 commit comments