1.1 KB36 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 {ConfigName} from 'isl/src/types';
9import type {ServerSideTracker} from './analytics/serverSideTracker';
10import type {Logger} from './logger';
11
12/**
13 * Per-connection context with which to access a repository.
14 * Repositories instances are shared and reused, but
15 * this context is not. It's used for any state that cannot be shared.
16 */
17export type RepositoryContext = {
18 cmd: string;
19 cwd: string;
20 logger: Logger;
21 tracker: ServerSideTracker;
22
23 knownConfigs?: ReadonlyMap<ConfigName, string> | undefined;
24 /** Whether we pass --debug to sl commands */
25 debug?: boolean;
26 /** Whether we pass --verbose to sl commands */
27 verbose?: boolean;
28 /**
29 * Configured merge tool, from `ui.merge`, as long as merge-tools.$tool.gui is also True.
30 * null -> no merge tool configured or not valid
31 * undefined -> not cached yet
32 */
33 cachedMergeTool?: string | null;
34 // TODO: visible commit age range
35};
36