summaryrefslogtreecommitdiff
path: root/server/src/git_socket.rs
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@spawned.biz>2025-01-26 21:58:42 +0100
committerJoel Klinghed <the_jk@spawned.biz>2025-01-26 21:58:42 +0100
commit9e80b8cd1e44fcf863d926055d9fa458db46e0d3 (patch)
tree1fd262ac79127e60d91f9e7efac9702ec3058cdb /server/src/git_socket.rs
parent42334c32226f0ff3248d6d0c7641b7170ca962ce (diff)
Add basic git support
Pushing a commit to a new branch creates a review. Each project has its own git directory, with githooks installed that talkes with server process via unix sockets.
Diffstat (limited to 'server/src/git_socket.rs')
-rw-r--r--server/src/git_socket.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/server/src/git_socket.rs b/server/src/git_socket.rs
new file mode 100644
index 0000000..90f9dc2
--- /dev/null
+++ b/server/src/git_socket.rs
@@ -0,0 +1,21 @@
+use serde::{Deserialize, Serialize};
+
+#[derive(Deserialize, Serialize)]
+pub struct GitReceive {
+ pub old_value: String,
+ pub new_value: String,
+ pub reference: String,
+}
+
+#[derive(Deserialize, Serialize)]
+pub struct GitHookRequest {
+ pub pre: bool,
+ pub user: String,
+ pub receive: Vec<GitReceive>,
+}
+
+#[derive(Deserialize, Serialize)]
+pub struct GitHookResponse {
+ pub ok: bool,
+ pub message: String,
+}