diff --git a/giterated-daemon/src/backend/git.rs b/giterated-daemon/src/backend/git.rs index 212988e..9cd21a0 100644 --- a/giterated-daemon/src/backend/git.rs +++ b/giterated-daemon/src/backend/git.rs @@ -179,6 +179,7 @@ impl GitBackend { user: &User, repository_name: &str, ) -> Result { + // TODO: Patch for use with new GetValue system if let Ok(repository) = sqlx::query_as!(GitRepository, r#"SELECT owner_user, name, description, visibility as "visibility: _", default_branch FROM repositories WHERE owner_user = $1 AND name = $2"#, user.to_string(), repository_name) @@ -831,7 +832,10 @@ impl RepositoryBackend for GitBackend { if let Some(search) = &request.search { // TODO: Caching // Search by sorting using a simple fuzzy search algorithm - filtered_branches.sort_by(|(n1, _, _, _), (n2, _, _, _)| strsim::damerau_levenshtein(search, n1).cmp(&strsim::damerau_levenshtein(search, n2))); + filtered_branches.sort_by(|(n1, _, _, _), (n2, _, _, _)| { + strsim::damerau_levenshtein(search, n1) + .cmp(&strsim::damerau_levenshtein(search, n2)) + }); } else { // Sort the branches by commit date filtered_branches.sort_by(|(_, _, _, c1), (_, _, _, c2)| c2.time.cmp(&c1.time)); diff --git a/giterated-stack/src/meta/mod.rs b/giterated-stack/src/meta/mod.rs index 62ed475..88a62e8 100644 --- a/giterated-stack/src/meta/mod.rs +++ b/giterated-stack/src/meta/mod.rs @@ -4,7 +4,7 @@ use futures_util::{future::LocalBoxFuture, FutureExt}; use giterated_models::{ object::GiteratedObject, operation::GiteratedOperation, - settings::{SetSetting, Setting}, + settings::{GetSetting, SetSetting, Setting}, value::{GetValue, GetValueTyped, GiteratedObjectValue}, }; use serde_json::Value; @@ -119,6 +119,10 @@ impl RuntimeMetadata { ObjectOperationPair::from_types::(), OperationMeta::new::(), ); + self.operations.insert( + ObjectOperationPair::from_types::(), + OperationMeta::new::(), + ); } pub fn append(&mut self, other: Self) {