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
//! The port to the remote side of a git source.
//!
//! Pure trait definition. No inline tests per the unit-test-mandate exemption #3: the trait body
//! has no executable logic.
//!
//! # Responsibilities
//!
//! - [`Git`] lists the tags of a remote, fetches a tag to the commit it names, and gives the files
//! of a commit as a tree.
//!
//! # Non-responsibilities
//!
//! It chooses nothing. Which tag is the newest and whether a tree matches the lock belong to the
//! rules in `types`; running `git` and keeping the cache belong to the `process` adapter.
use crateFileTree;
use crate;
use crate;
/// A git remote, reached through its URL.
///
/// Every failure is a [`FetchError`] without a location: the flow adds `agentstacks.toml` and the
/// key of the entry that named the source. An implementation reports:
///
/// - git not on `PATH` as [`FetchError::GitNotFound`] with an empty `needed_by` on every call. The
/// flow merges the answers of every source into one refusal.
/// - git exiting with a failure as [`FetchError::GitFailed`], with the subcommand and git's stderr.
/// - git failing to start for another reason as [`FetchError::GitSpawn`].
/// - git output that cannot be read (a tag line, a tree record, a commit id, a blob frame) as
/// [`FetchError::GitUnreadable`], with the subcommand and the first line of the output.
/// - a failed cache operation as [`FetchError::CacheIo`], with the path involved.
/// - a `subdir` that is not a directory in the source as [`FetchError::SubdirNotFound`] or
/// [`FetchError::SubdirIsFile`], and an unset or empty `HOME` as [`FetchError::HomeUnset`].