960 B42 lines
Blame
1/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8import type {CommandArg, RepoRelativePath} from '../types';
9
10import {Operation} from './Operation';
11
12export class ResolveInExternalMergeToolOperation extends Operation {
13 constructor(
14 private tool: string,
15 private filePath?: RepoRelativePath,
16 ) {
17 super('ResolveInExternalMergeToolOperation');
18 }
19
20 static opName = 'ResolveInExternalMergeToolOperation';
21
22 getArgs() {
23 const args: Array<CommandArg> = [
24 'resolve',
25 '--tool',
26 this.tool,
27 // skip merge drivers, since we're just looking to resolve in the UI.
28 '--skip',
29 ];
30
31 if (this.filePath) {
32 args.push({
33 type: 'repo-relative-file' as const,
34 path: this.filePath,
35 });
36 } else {
37 args.push('--all');
38 }
39 return args;
40 }
41}
42