Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
185 changes: 0 additions & 185 deletions crates/but/src/command/legacy/base.rs

This file was deleted.

46 changes: 46 additions & 0 deletions crates/but/src/command/legacy/base/json.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
//! JSON output structures for `but base` commands.

use serde::Serialize;

/// JSON output for `but base check`
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub(super) struct BaseCheckOutput {
pub base_branch: BaseBranchInfo,
pub upstream_commits: UpstreamInfo,
pub branch_statuses: Vec<BranchStatusInfo>,
pub up_to_date: bool,
pub has_worktree_conflicts: bool,
}

#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub(super) struct BaseBranchInfo {
pub name: String,
pub remote_name: String,
pub base_sha: String,
pub current_sha: String,
}

#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub(super) struct UpstreamInfo {
pub count: usize,
pub commits: Vec<UpstreamCommit>,
}

#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub(super) struct UpstreamCommit {
pub id: String,
pub description: String,
pub author_name: String,
}

#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub(super) struct BranchStatusInfo {
pub name: String,
pub status: String,
pub rebasable: Option<bool>,
}
Loading
Loading