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
//! Upload-pack protocol handler (server side of fetch/clone).
//!
//! Serves fetch and clone over smart HTTP by calling [`grit_lib::remote::serve::upload_pack`]
//! in-process.
use Path;
use RepositoryOptions;
use crate::;
/// Run upload-pack ref advertisement (for `GET /info/refs?service=git-upload-pack`).
///
/// Returns the raw pkt-line advertisement bytes (the v0/v1 ref list, or the v2
/// capability list when `protocol_version` is `Some(2)`) suitable for wrapping in an
/// HTTP response with the service header.
///
/// # Parameters
///
/// - `repository_options`: environment used to load global/system config (hide refs).
///
/// # Errors
///
/// Fails when `repo_path` is not a repository or advertisement generation fails.
/// Run a stateless upload-pack RPC exchange (for `POST /git-upload-pack`).
///
/// Takes the request body as input and returns the response body.
/// Supports both protocol v0/v1 and v2 via `protocol_version`.
///
/// # Errors
///
/// Fails when the repository cannot be opened or the exchange fails.