From d780391408b9e6d443e5e4f907748cae484b79fb Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Sat, 1 Feb 2025 22:42:11 +0100 Subject: Use workspace instead of features Having to include --feature=build-server in basically all commands that wasn't building eyeballs-githook got tiring quickly. Instead, use workspaces, with a separate project for building the githook. It means I also had to add a library common with code shared by both githook and server. --- server/common/src/git_socket.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 server/common/src/git_socket.rs (limited to 'server/common/src/git_socket.rs') 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, +} + +#[derive(Deserialize, Serialize)] +pub struct GitHookRequest { + pub pre: bool, + pub receive: Vec, +} + +#[derive(Deserialize, Serialize)] +pub struct GitHookResponse { + pub ok: bool, + pub message: String, +} -- cgit v1.2.3-70-g09d2