// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
import { ProjectChangeAnalyzer } from '../ProjectChangeAnalyzer';
export class GitChangedProjectSelectorParser {
    constructor(rushConfiguration, options) {
        this._rushConfiguration = rushConfiguration;
        this._options = options;
    }
    async evaluateSelectorAsync({ unscopedSelector, terminal }) {
        const projectChangeAnalyzer = new ProjectChangeAnalyzer(this._rushConfiguration);
        const options = {
            terminal,
            targetBranchName: unscopedSelector,
            ...this._options
        };
        return await projectChangeAnalyzer.getChangedProjectsAsync(options);
    }
    getCompletions() {
        return [this._rushConfiguration.repositoryDefaultBranch, 'HEAD~1', 'HEAD'];
    }
}
//# sourceMappingURL=GitChangedProjectSelectorParser.js.map