Skip to content

Commit 213806b

Browse files
committed
Re-add HexHash to Request struct for create_reference call (#12354)
This was changed by accident, and a way to prevent such mistakes in future would be to not add serde support to `gix` types.
1 parent 1bba3a6 commit 213806b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

crates/but-api/src/legacy/stack.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ use tracing::instrument;
1313
pub mod create_reference {
1414
use serde::{Deserialize, Serialize};
1515

16+
use crate::json::HexHash;
17+
1618
#[derive(Deserialize, Serialize, Debug)]
1719
#[serde(rename_all = "camelCase")]
1820
pub struct Request {
@@ -26,7 +28,7 @@ pub mod create_reference {
2628
#[serde(tag = "type", content = "subject", rename_all = "camelCase")]
2729
pub enum Anchor {
2830
AtCommit {
29-
commit_id: gix::ObjectId,
31+
commit_id: HexHash,
3032
position: but_workspace::branch::create_reference::Position,
3133
},
3234
AtReference {
@@ -51,7 +53,10 @@ pub fn create_reference(
5153
.map(|anchor| -> Result<_> {
5254
Ok(match anchor {
5355
create_reference::Anchor::AtCommit { commit_id, position } => {
54-
but_workspace::branch::create_reference::Anchor::AtCommit { commit_id, position }
56+
but_workspace::branch::create_reference::Anchor::AtCommit {
57+
commit_id: commit_id.into(),
58+
position,
59+
}
5560
}
5661
create_reference::Anchor::AtReference { short_name, position } => {
5762
but_workspace::branch::create_reference::Anchor::AtSegment {

0 commit comments

Comments
 (0)