|
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';
|
@@ -463,18 +463,42 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
|
463 | 463 | }
|
464 | 464 |
|
465 | 465 | private async abortPausedOperation(pausedOpArgs: GitPausedOperationCommandArgs) {
|
466 |
| - await this.container.git.status(pausedOpArgs.operation.repoPath).abortPausedOperation?.(); |
| 466 | + const abortPausedOperation = this.container.git.status(pausedOpArgs.operation.repoPath).abortPausedOperation; |
| 467 | + if (abortPausedOperation == null) return; |
| 468 | + |
| 469 | + try { |
| 470 | + await abortPausedOperation(); |
| 471 | + } catch (ex) { |
| 472 | + void window.showErrorMessage(ex.message); |
| 473 | + } |
467 | 474 | }
|
468 | 475 |
|
469 | 476 | private async continuePausedOperation(pausedOpArgs: GitPausedOperationCommandArgs) {
|
470 | 477 | if (pausedOpArgs.operation.type === 'revert') return;
|
471 |
| - await this.container.git.status(pausedOpArgs.operation.repoPath).continuePausedOperation?.(); |
| 478 | + |
| 479 | + const continuePausedOperation = this.container.git.status( |
| 480 | + pausedOpArgs.operation.repoPath, |
| 481 | + ).continuePausedOperation; |
| 482 | + if (continuePausedOperation == null) return; |
| 483 | + |
| 484 | + try { |
| 485 | + await continuePausedOperation(); |
| 486 | + } catch (ex) { |
| 487 | + void window.showErrorMessage(ex.message); |
| 488 | + } |
472 | 489 | }
|
473 | 490 |
|
474 | 491 | private async skipPausedOperation(pausedOpArgs: GitPausedOperationCommandArgs) {
|
475 |
| - if (pausedOpArgs.operation.type === 'merge') return; |
476 |
| - |
477 |
| - await this.container.git.status(pausedOpArgs.operation.repoPath).continuePausedOperation?.({ skip: true }); |
| 492 | + const continuePausedOperation = this.container.git.status( |
| 493 | + pausedOpArgs.operation.repoPath, |
| 494 | + ).continuePausedOperation; |
| 495 | + if (continuePausedOperation == null) return; |
| 496 | + |
| 497 | + try { |
| 498 | + await continuePausedOperation({ skip: true }); |
| 499 | + } catch (ex) { |
| 500 | + void window.showErrorMessage(ex.message); |
| 501 | + } |
478 | 502 | }
|
479 | 503 |
|
480 | 504 | private async openRebaseEditor(pausedOpArgs: GitPausedOperationCommandArgs) {
|
|
0 commit comments