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
//! What:
//! The thin native cli-git executable.
//! Why:
//! Process facts are gathered once here;
//! every decision lives in the library.
//!
//! In TS you'd write (pseudocode):
//! ```ts
//! process.exit(runProcess(process.argv.slice(2), Object.entries(process.env)));
//! ```
/// What:
/// `OsString` is owned operating-system text of raw OS bytes (sibling `String`
/// must be UTF-8).
/// Why:
/// Arguments and environment values reach Git exactly as the caller gave them.
///
/// In TS you'd write (pseudocode):
/// ```ts
/// // process.argv / process.env, but byte-preserving.
/// ```
use OsString;
/// What:
/// The program entry point:
/// collect arguments and environment,
/// run,
/// exit.
/// Why:
/// `args_os`/`vars_os` never decode,
/// so non-UTF-8 arguments neither panic nor
/// change.
/// A forwarded command replaces this process and never reaches the exit.
///
/// In TS you'd write (pseudocode):
/// ```ts
/// function main(): never { process.exit(runProcess(argv, env)); }
/// ```