summaryrefslogtreecommitdiff
path: root/server/common/src/git_socket.rs
diff options
context:
space:
mode:
Diffstat (limited to 'server/common/src/git_socket.rs')
-rw-r--r--server/common/src/git_socket.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/server/common/src/git_socket.rs b/server/common/src/git_socket.rs
new file mode 100644
index 0000000..a4805be
--- /dev/null
+++ b/server/common/src/git_socket.rs
@@ -0,0 +1,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,
+}