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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
export const TRUE = true;
export const FALSE = false;
export const passphrase = "Za39PSymj5EcuzMs9kSNsAS3KbfzKHHP";
export const gitDir = new URL("file:///home/user/project/");
const gitLogPrettyOutput = new TextEncoder().encode([
"abcdef1234567890abcdef1234567890abcdef12", // long hash
"abcdef1", // short hash
"2024-06-17T12:00:00Z", // author date
"Alice", // author name
"alice@example.com", // author email
"2024-06-17T12:01:00Z", // committer date
"Bob", // committer name
"bob@example.com", // committer email
"bob@example.com", // signer
"ABCDEF", // key (short)
"ABCDEF123456", // key fingerprint (long)
"gpg: Signature made...", // raw line 1
"gpg: Good signature from...", // raw line 2
].join("\n")) as Uint8Array<ArrayBuffer>;
const gitDiffTreeOutput = new TextEncoder().encode([
"M\tfile.ts",
"A\tnew_file.ts",
].join("\n")) as Uint8Array<ArrayBuffer>;
const emptyOutput = new TextEncoder().encode("") as Uint8Array<ArrayBuffer>;
export const gitLogPrettyCommandOutput: Promise<Deno.CommandOutput> = Promise
.resolve({
stdout: gitLogPrettyOutput,
code: 0,
signal: null,
stderr: emptyOutput,
success: true,
});
export const gitDiffTreeCommandOutput: Promise<Deno.CommandOutput> = Promise
.resolve({
stdout: gitDiffTreeOutput,
code: 0,
signal: null,
stderr: emptyOutput,
success: true,
});
export const gitRevParseCommandOutput: Promise<Deno.CommandOutput> = Promise
.resolve({
stdout: new TextEncoder().encode(gitDir.pathname) as Uint8Array<
ArrayBuffer
>,
code: 0,
signal: null,
stderr: emptyOutput,
success: true,
});
export const emptyCommandOutput: Promise<Deno.CommandOutput> = Promise.resolve({
stdout: emptyOutput,
code: 0,
signal: null,
stderr: emptyOutput,
success: true,
});
|