don't
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor(knot): only pass parameters `TangledRepository::merge_check` needs

Signed-off-by: tjh <x@tjh.dev>

tjh e83de231 7f2c9723

+13 -12
+3 -7
crates/knot/src/model/repository/merge_check.rs
··· 1 1 use std::{borrow::Cow, io::Write as _, process::Stdio}; 2 2 3 3 use axum::Json; 4 - use lexicon::sh_tangled::repo::merge_check::{ConflictInfo, Input, Output}; 4 + use lexicon::sh_tangled::repo::merge_check::{ConflictInfo, Output}; 5 5 6 6 use crate::{ 7 7 model::{ ··· 14 14 impl super::TangledRepository { 15 15 pub fn merge_check( 16 16 &self, 17 - Input { 18 - did: _, 19 - name: _, 20 - patch, 21 - branch, 22 - }: Input, 17 + patch: String, 18 + branch: &str, 23 19 ) -> Result<XrpcResponse<Json<Output>>, XrpcError> { 24 20 let ResolvedRevspec { commit, immutable } = 25 21 self.repository.resolve_revspec(&Some(branch.as_ref()))?;
+10 -5
crates/knot/src/public/xrpc/sh_tangled/repo/impl_merge_check.rs
··· 10 10 11 11 pub const LXM: &str = "/sh.tangled.repo.mergeCheck"; 12 12 13 - #[tracing::instrument(target = "sh_tangled::repo::merge_check", skip(knot), err)] 13 + #[tracing::instrument(target = "sh_tangled::repo::merge_check", skip(knot, patch), err)] 14 14 pub async fn handle( 15 15 State(knot): State<Knot>, 16 - Json(params): Json<Input>, 16 + Json(Input { 17 + did, 18 + name, 19 + patch, 20 + branch, 21 + }): Json<Input>, 17 22 ) -> XrpcResult<Json<Output>> { 18 23 let repo_path = RepositoryPath { 19 - owner: params.did.into_boxed().into(), 20 - name: params.name.clone().into_boxed_str(), 24 + owner: did.into_boxed().into(), 25 + name: name.into_boxed_str(), 21 26 }; 22 27 23 28 let repo_key = knot ··· 39 34 let repository: TangledRepository = (knot.clone(), repo_key, repo).into(); 40 35 41 36 knot.pool() 42 - .spawn_async(move || repository.merge_check(params)) 37 + .spawn_async(move || repository.merge_check(patch, &branch)) 43 38 .await 44 39 }