Skip to content
Merged
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
9 changes: 7 additions & 2 deletions crates/but-api/src/legacy/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ use tracing::instrument;
pub mod create_reference {
use serde::{Deserialize, Serialize};

use crate::json::HexHash;

#[derive(Deserialize, Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct Request {
Expand All @@ -26,7 +28,7 @@ pub mod create_reference {
#[serde(tag = "type", content = "subject", rename_all = "camelCase")]
pub enum Anchor {
AtCommit {
commit_id: gix::ObjectId,
commit_id: HexHash,
position: but_workspace::branch::create_reference::Position,
},
AtReference {
Expand All @@ -51,7 +53,10 @@ pub fn create_reference(
.map(|anchor| -> Result<_> {
Ok(match anchor {
create_reference::Anchor::AtCommit { commit_id, position } => {
but_workspace::branch::create_reference::Anchor::AtCommit { commit_id, position }
but_workspace::branch::create_reference::Anchor::AtCommit {
commit_id: commit_id.into(),
position,
}
}
create_reference::Anchor::AtReference { short_name, position } => {
but_workspace::branch::create_reference::Anchor::AtSegment {
Expand Down
3 changes: 2 additions & 1 deletion crates/but/src/command/legacy/branch/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use anyhow::bail;
use branch::Subcommands;
use but_api::json::HexHash;
use but_core::ref_metadata::StackId;
use colored::Colorize;

Expand Down Expand Up @@ -83,7 +84,7 @@ pub fn handle(cmd: Option<Subcommands>, ctx: &mut but_ctx::Context, out: &mut Ou
match anchor_id {
CliId::Commit { commit_id: oid, .. } => {
Some(but_api::legacy::stack::create_reference::Anchor::AtCommit {
commit_id: (*oid),
commit_id: HexHash(*oid),
position: but_workspace::branch::create_reference::Position::Above,
})
}
Expand Down
Loading