summaryrefslogtreecommitdiff
path: root/server/common/src/git_socket.rs
blob: a4805be04b8ed7e3dcef2c360d79e9ce88b40fe7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use serde::{Deserialize, Serialize};

#[derive(Deserialize, Serialize)]
pub struct GitReceive {
    pub old_value: String,
    pub new_value: String,
    pub reference: String,
    // Only set for pre hooks, because server can't read the objects the pre-hook has not yet
    // accepted, so to be able to validate the commiter, send them. Also only set if new_value
    // is not empty.
    pub commiter: Option<String>,
}

#[derive(Deserialize, Serialize)]
pub struct GitHookRequest {
    pub pre: bool,
    pub receive: Vec<GitReceive>,
}

#[derive(Deserialize, Serialize)]
pub struct GitHookResponse {
    pub ok: bool,
    pub message: String,
}