forked from microsoft/vscode-pull-request-github
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfile.ts
More file actions
46 lines (41 loc) · 1.3 KB
/
Copy pathfile.ts
File metadata and controls
46 lines (41 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { DiffHunk } from './diffHunk';
export enum GitChangeType {
ADD,
COPY,
DELETE,
MODIFY,
RENAME,
TYPE,
UNKNOWN,
UNMERGED,
}
export interface SimpleFileChange {
readonly status: GitChangeType;
readonly fileName: string;
readonly blobUrl: string | undefined;
readonly diffHunks?: DiffHunk[];
}
export class InMemFileChange implements SimpleFileChange {
constructor(
public readonly baseCommit: string,
public readonly status: GitChangeType,
public readonly fileName: string,
public readonly previousFileName: string | undefined,
public readonly patch: string,
public readonly diffHunks: DiffHunk[] | undefined,
public readonly blobUrl: string,
) { }
}
export class SlimFileChange implements SimpleFileChange {
constructor(
public readonly baseCommit: string,
public readonly blobUrl: string,
public readonly status: GitChangeType,
public readonly fileName: string,
public readonly previousFileName: string | undefined,
) { }
}