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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
//! What:
//! Why the probe of a manual push could not establish the updates Git would push,
//! and what Git itself said when it refused.
//! Why:
//! The probe (`manual_push_probe.rs`) and the lifecycle that reads its result share these types;
//! they sit in a file of their
//! own so the probe stays under the file-size limit and this file needs nothing from it.
//!
//! In TS you'd write (pseudocode):
//! ```ts
//! class ManualPushProbeError extends Error { refusal?: GitRefusal }
//! ```
use crateSingleFlightError;
use crateManualPushCause;
/// What:
/// Git's own refusal of a push:
/// the exit status and the standard error it ended with.
/// Why:
/// When the dry run exits with a failure before it reports any destination,
/// Git has refused the push itself (a ref to
/// delete that the remote lacks,
/// a refspec naming nothing,
/// a remote that does not exist,
/// an option it does not know).
/// Nothing could be published,
/// so Git's words and status are the answer,
/// and the wrapper adds none of its own.
///
/// In TS you'd write (pseudocode):
/// ```ts
/// type GitRefusal = { code: number; stderr: string };
/// ```
/// What:
/// Why the probe could not establish the updates Git would push.
/// Why:
/// Every variant stops the policy lifecycle;
/// none guesses an update.
/// A failure of the wrapper's own reading is a
/// content-unavailable engine failure,
/// and a refusal by Git carries Git's own report instead.
///
/// In TS you'd write (pseudocode):
/// ```ts
/// class ManualPushProbeError extends Error { refusal?: GitRefusal }
/// ```
/// Build a probe error from text.
///
/// In TS you'd write (pseudocode):
/// ```ts
/// new ManualPushProbeError(cause, message)
/// ```
pub
/// What:
/// The cause of a Git query that could not produce an exit status.
/// Why:
/// A query that never started means the Git the wrapper runs is missing;
/// one stopped at its deadline already says in its
/// message which setting changes the deadline;
/// anything else Git did not explain.
///
/// In TS you'd write (pseudocode):
/// ```ts
/// error instanceof StartError ? 'git-not-started' : error instanceof TimedOut ? 'self-explained' : 'git-silent'
/// ```
pub