export class StubGitCommandExecutor {
    calls = [];
    responsesByKind = new Map();
    defaultResult = { exitCode: 0, stdout: '', stderr: '' };
    programResponse(kind, result) {
        const existing = this.responsesByKind.get(kind) ?? [];
        existing.push(result);
        this.responsesByKind.set(kind, existing);
    }
    async execute(command) {
        this.calls.push(command);
        const queue = this.responsesByKind.get(command.kind);
        if (queue && queue.length > 0) {
            const next = queue.shift();
            if (next !== undefined) {
                return next;
            }
        }
        return this.defaultResult;
    }
    callsOfKind(kind) {
        return this.calls.filter(call => call.kind === kind);
    }
}
//# sourceMappingURL=gitCommandExecutor.stub.js.map