GitRoot

craft your forge, build your project, grow your community freely
 1// SPDX-FileCopyrightText: 2025 Romain Maneschi <romain@gitroot.dev>
 2//
 3// SPDX-License-Identifier: MIT
 4
 5use serde::{Deserialize, Serialize};
 6
 7#[derive(Debug, Deserialize, Serialize, Clone)]
 8#[serde(rename_all = "lowercase")]
 9pub enum FileActionType {
10    ADD,
11    MOD,
12    DEL,
13}
14
15#[derive(Debug, Deserialize)]
16#[serde(rename_all = "camelCase")]
17pub struct File {
18    pub path: String,
19    pub file_hash: String,
20    pub old_path: String,      //only if action == FileActionTypeMod
21    pub old_file_hash: String, //only if action == FileActionTypeMod
22    pub action: FileActionType,
23}