Git - add onDidCheckout extension API event (#234483)

pull/234509/head
Ladislau Szomoru 2024-11-24 01:51:17 +01:00 committed by GitHub
parent 9088a3747d
commit 213334eb80
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 2 deletions

View File

@ -12,7 +12,7 @@ import { toGitUri } from '../uri';
import { GitExtensionImpl } from './extension';
import { GitBaseApi } from '../git-base';
import { PickRemoteSourceOptions } from './git-base';
import { Operation, OperationResult } from '../operation';
import { OperationKind, OperationResult } from '../operation';
class ApiInputBox implements InputBox {
set value(value: string) { this._inputBox.value = value; }
@ -67,7 +67,11 @@ export class ApiRepository implements Repository {
readonly state: RepositoryState = new ApiRepositoryState(this.repository);
readonly ui: RepositoryUIState = new ApiRepositoryUIState(this.repository.sourceControl);
readonly onDidCommit: Event<void> = mapEvent<OperationResult, void>(filterEvent(this.repository.onDidRunOperation, e => e.operation === Operation.Commit), () => null);
readonly onDidCommit: Event<void> = mapEvent<OperationResult, void>(
filterEvent(this.repository.onDidRunOperation, e => e.operation.kind === OperationKind.Commit), () => null);
readonly onDidCheckout: Event<void> = mapEvent<OperationResult, void>(
filterEvent(this.repository.onDidRunOperation, e => e.operation.kind === OperationKind.Checkout || e.operation.kind === OperationKind.CheckoutTracking), () => null);
constructor(readonly repository: BaseRepository) { }