Skip to main content

mesa_dev/models/
branch.rs

1//! Branch models.
2
3use serde::{Deserialize, Serialize};
4
5/// A branch in a repository.
6#[derive(Debug, Clone, Deserialize)]
7pub struct Branch {
8    /// Branch name.
9    pub name: String,
10    /// SHA of the branch head commit.
11    pub head_sha: String,
12    /// Whether this is the default branch.
13    pub is_default: bool,
14}
15
16/// Request body for creating a branch.
17#[derive(Debug, Clone, Serialize)]
18pub struct CreateBranchRequest {
19    /// Name for the new branch.
20    pub name: String,
21    /// SHA or branch name to create from.
22    pub from: String,
23}
24
25/// Paginated list of branches.
26#[derive(Debug, Clone, Deserialize)]
27pub struct ListBranchesResponse {
28    /// The branches in this page.
29    pub branches: Vec<Branch>,
30    /// Cursor for the next page, if more results exist.
31    pub next_cursor: Option<String>,
32    /// Whether more results are available.
33    pub has_more: bool,
34}