From fcd315bc27a1484d2a4b8713e04d24e2c62b86b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Tue, 5 Nov 2024 23:37:16 +0100 Subject: [PATCH 01/20] Fix some clippy lints --- build.rs | 2 +- src/auth.rs | 12 +- src/config.rs | 28 +-- src/grm/main.rs | 115 +++++---- src/lib.rs | 15 +- src/output.rs | 6 +- src/path.rs | 72 +++--- src/provider/gitlab.rs | 9 +- src/provider/mod.rs | 14 +- src/repo.rs | 541 ++++++++++++++++++++--------------------- src/table.rs | 55 ++--- src/tree.rs | 42 ++-- src/worktree.rs | 71 +++--- 13 files changed, 473 insertions(+), 509 deletions(-) diff --git a/build.rs b/build.rs index db83273..82b1185 100644 --- a/build.rs +++ b/build.rs @@ -1,6 +1,6 @@ fn main() { if let Ok(v) = std::env::var("GRM_RELEASE_VERSION") { - println!("cargo:rustc-env=CARGO_PKG_VERSION={}", v); + println!("cargo:rustc-env=CARGO_PKG_VERSION={v}"); } println!("cargo:rerun-if-env-changed=GRM_RELEASE_VERSION"); } diff --git a/src/auth.rs b/src/auth.rs index 5ab5119..c83a736 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -15,21 +15,21 @@ pub fn get_token_from_command(command: &str) -> Result { .arg("-c") .arg(command) .output() - .map_err(|error| format!("Failed to run token-command: {}", error))?; + .map_err(|error| format!("Failed to run token-command: {error}"))?; let stderr = String::from_utf8(output.stderr).map_err(|error| error.to_string())?; let stdout = String::from_utf8(output.stdout).map_err(|error| error.to_string())?; if !output.status.success() { - if !stderr.is_empty() { - return Err(format!("Token command failed: {}", stderr)); + return if !stderr.is_empty() { + Err(format!("Token command failed: {stderr}")) } else { - return Err(String::from("Token command failed.")); - } + Err(String::from("Token command failed.")) + }; } if !stderr.is_empty() { - return Err(format!("Token command produced stderr: {}", stderr)); + return Err(format!("Token command produced stderr: {stderr}")); } if stdout.is_empty() { diff --git a/src/config.rs b/src/config.rs index 700384b..a8e78ff 100644 --- a/src/config.rs +++ b/src/config.rs @@ -134,11 +134,11 @@ impl ConfigTrees { } pub fn from_vec(vec: Vec) -> Self { - ConfigTrees { trees: vec } + Self { trees: vec } } pub fn from_trees(vec: Vec) -> Self { - ConfigTrees { + Self { trees: vec.into_iter().map(ConfigTree::from_tree).collect(), } } @@ -159,12 +159,12 @@ impl ConfigTrees { impl Config { pub fn trees(self) -> Result, String> { match self { - Config::ConfigTrees(config) => Ok(config.trees), - Config::ConfigProvider(config) => { + Self::ConfigTrees(config) => Ok(config.trees), + Self::ConfigProvider(config) => { let token = match auth::get_token_from_command(&config.token_command) { Ok(token) => token, Err(error) => { - print_error(&format!("Getting token from command failed: {}", error)); + print_error(&format!("Getting token from command failed: {error}")); process::exit(1); } }; @@ -194,7 +194,7 @@ impl Config { match provider::Github::new(filter, token, config.api_url) { Ok(provider) => provider, Err(error) => { - print_error(&format!("Error: {}", error)); + print_error(&format!("Error: {error}")); process::exit(1); } } @@ -208,7 +208,7 @@ impl Config { match provider::Gitlab::new(filter, token, config.api_url) { Ok(provider) => provider, Err(error) => { - print_error(&format!("Error: {}", error)); + print_error(&format!("Error: {error}")); process::exit(1); } } @@ -243,11 +243,11 @@ impl Config { } pub fn from_trees(trees: Vec) -> Self { - Config::ConfigTrees(ConfigTrees { trees }) + Self::ConfigTrees(ConfigTrees { trees }) } pub fn normalize(&mut self) { - if let Config::ConfigTrees(config) = self { + if let Self::ConfigTrees(config) = self { let home = path::env_home(); for tree in &mut config.trees_mut().iter_mut() { if tree.root.starts_with(&home) { @@ -310,8 +310,7 @@ where Ok(s) => s, Err(e) => { return Err(format!( - "Error reading configuration file \"{}\": {}", - path, + "Error reading configuration file \"{path}\": {}", match e.kind() { std::io::ErrorKind::NotFound => String::from("not found"), _ => e.to_string(), @@ -324,12 +323,7 @@ where Ok(c) => c, Err(_) => match serde_yaml::from_str(&content) { Ok(c) => c, - Err(e) => { - return Err(format!( - "Error parsing configuration file \"{}\": {}", - path, e - )) - } + Err(e) => return Err(format!("Error parsing configuration file \"{path}\": {e}",)), }, }; diff --git a/src/grm/main.rs b/src/grm/main.rs index 3d02872..9f8893d 100644 --- a/src/grm/main.rs +++ b/src/grm/main.rs @@ -38,7 +38,7 @@ fn main() { } } Err(error) => { - print_error(&format!("Sync error: {}", error)); + print_error(&format!("Sync error: {error}")); process::exit(1); } } @@ -47,7 +47,7 @@ fn main() { let token = match auth::get_token_from_command(&args.token_command) { Ok(token) => token, Err(error) => { - print_error(&format!("Getting token from command failed: {}", error)); + print_error(&format!("Getting token from command failed: {error}")); process::exit(1); } }; @@ -66,7 +66,7 @@ fn main() { match provider::Github::new(filter, token, args.api_url) { Ok(provider) => provider, Err(error) => { - print_error(&format!("Sync error: {}", error)); + print_error(&format!("Sync error: {error}")); process::exit(1); } } @@ -80,7 +80,7 @@ fn main() { match provider::Gitlab::new(filter, token, args.api_url) { Ok(provider) => provider, Err(error) => { - print_error(&format!("Sync error: {}", error)); + print_error(&format!("Sync error: {error}")); process::exit(1); } } @@ -116,13 +116,13 @@ fn main() { } } Err(error) => { - print_error(&format!("Sync error: {}", error)); + print_error(&format!("Sync error: {error}")); process::exit(1); } } } Err(error) => { - print_error(&format!("Sync error: {}", error)); + print_error(&format!("Sync error: {error}")); process::exit(1); } } @@ -140,14 +140,14 @@ fn main() { match table::get_status_table(config) { Ok((tables, errors)) => { for table in tables { - println!("{}", table); + println!("{table}"); } for error in errors { - print_error(&format!("Error: {}", error)); + print_error(&format!("Error: {error}")); } } Err(error) => { - print_error(&format!("Error getting status: {}", error)); + print_error(&format!("Error getting status: {error}")); process::exit(1); } } @@ -156,20 +156,20 @@ fn main() { let dir = match std::env::current_dir() { Ok(dir) => dir, Err(error) => { - print_error(&format!("Could not open current directory: {}", error)); + print_error(&format!("Could not open current directory: {error}")); process::exit(1); } }; match table::show_single_repo_status(&dir) { Ok((table, warnings)) => { - println!("{}", table); + println!("{table}"); for warning in warnings { print_warning(&warning); } } Err(error) => { - print_error(&format!("Error getting status: {}", error)); + print_error(&format!("Error getting status: {error}")); process::exit(1); } } @@ -231,7 +231,7 @@ fn main() { process::exit(1); } }; - print!("{}", toml); + print!("{toml}"); } cmd::ConfigFormat::Yaml => { let yaml = match config.as_yaml() { @@ -244,7 +244,7 @@ fn main() { process::exit(1); } }; - print!("{}", yaml); + print!("{yaml}"); } } } @@ -264,7 +264,7 @@ fn main() { let token = match auth::get_token_from_command(&config.token_command) { Ok(token) => token, Err(error) => { - print_error(&format!("Getting token from command failed: {}", error)); + print_error(&format!("Getting token from command failed: {error}")); process::exit(1); } }; @@ -292,7 +292,7 @@ fn main() { match match provider::Github::new(filter, token, config.api_url) { Ok(provider) => provider, Err(error) => { - print_error(&format!("Error: {}", error)); + print_error(&format!("Error: {error}")); process::exit(1); } } @@ -303,7 +303,7 @@ fn main() { ) { Ok(provider) => provider, Err(error) => { - print_error(&format!("Error: {}", error)); + print_error(&format!("Error: {error}")); process::exit(1); } } @@ -312,7 +312,7 @@ fn main() { match match provider::Gitlab::new(filter, token, config.api_url) { Ok(provider) => provider, Err(error) => { - print_error(&format!("Error: {}", error)); + print_error(&format!("Error: {error}")); process::exit(1); } } @@ -323,7 +323,7 @@ fn main() { ) { Ok(provider) => provider, Err(error) => { - print_error(&format!("Error: {}", error)); + print_error(&format!("Error: {error}")); process::exit(1); } } @@ -363,7 +363,7 @@ fn main() { process::exit(1); } }; - print!("{}", toml); + print!("{toml}"); } cmd::ConfigFormat::Yaml => { let yaml = match config.as_yaml() { @@ -376,7 +376,7 @@ fn main() { process::exit(1); } }; - print!("{}", yaml); + print!("{yaml}"); } } } @@ -384,7 +384,7 @@ fn main() { let token = match auth::get_token_from_command(&args.token_command) { Ok(token) => token, Err(error) => { - print_error(&format!("Getting token from command failed: {}", error)); + print_error(&format!("Getting token from command failed: {error}")); process::exit(1); } }; @@ -403,7 +403,7 @@ fn main() { match provider::Github::new(filter, token, args.api_url) { Ok(provider) => provider, Err(error) => { - print_error(&format!("Error: {}", error)); + print_error(&format!("Error: {error}")); process::exit(1); } } @@ -417,7 +417,7 @@ fn main() { match provider::Gitlab::new(filter, token, args.api_url) { Ok(provider) => provider, Err(error) => { - print_error(&format!("Error: {}", error)); + print_error(&format!("Error: {error}")); process::exit(1); } } @@ -430,7 +430,7 @@ fn main() { }; let repos = repos.unwrap_or_else(|error| { - print_error(&format!("Error: {}", error)); + print_error(&format!("Error: {error}")); process::exit(1); }); @@ -469,7 +469,7 @@ fn main() { process::exit(1); } }; - print!("{}", toml); + print!("{toml}"); } cmd::ConfigFormat::Yaml => { let yaml = match config.as_yaml() { @@ -482,7 +482,7 @@ fn main() { process::exit(1); } }; - print!("{}", yaml); + print!("{yaml}"); } } } @@ -490,7 +490,7 @@ fn main() { }, cmd::SubCommand::Worktree(args) => { let cwd = std::env::current_dir().unwrap_or_else(|error| { - print_error(&format!("Could not open current directory: {}", error)); + print_error(&format!("Could not open current directory: {error}")); process::exit(1); }); @@ -535,7 +535,7 @@ fn main() { print_success(&format!("Worktree {} created", &action_args.name)); } Err(error) => { - print_error(&format!("Error creating worktree: {}", error)); + print_error(&format!("Error creating worktree: {error}")); process::exit(1); } } @@ -544,16 +544,13 @@ fn main() { let worktree_config = match repo::read_worktree_root_config(&cwd) { Ok(config) => config, Err(error) => { - print_error(&format!( - "Error getting worktree configuration: {}", - error - )); + print_error(&format!("Error getting worktree configuration: {error}")); process::exit(1); } }; let repo = repo::RepoHandle::open(&cwd, true).unwrap_or_else(|error| { - print_error(&format!("Error opening repository: {}", error)); + print_error(&format!("Error opening repository: {error}")); process::exit(1); }); @@ -564,7 +561,7 @@ fn main() { action_args.force, &worktree_config, ) { - Ok(_) => print_success(&format!("Worktree {} deleted", &action_args.name)), + Ok(()) => print_success(&format!("Worktree {} deleted", &action_args.name)), Err(error) => { match error { repo::WorktreeRemoveFailureReason::Error(msg) => { @@ -573,8 +570,7 @@ fn main() { } repo::WorktreeRemoveFailureReason::Changes(changes) => { print_warning(&format!( - "Changes in worktree: {}. Refusing to delete", - changes + "Changes in worktree: {changes}. Refusing to delete" )); } repo::WorktreeRemoveFailureReason::NotMerged(message) => { @@ -587,19 +583,19 @@ fn main() { } cmd::WorktreeAction::Status(_args) => { let repo = repo::RepoHandle::open(&cwd, true).unwrap_or_else(|error| { - print_error(&format!("Error opening repository: {}", error)); + print_error(&format!("Error opening repository: {error}")); process::exit(1); }); match table::get_worktree_status_table(&repo, &cwd) { Ok((table, errors)) => { - println!("{}", table); + println!("{table}"); for error in errors { - print_error(&format!("Error: {}", error)); + print_error(&format!("Error: {error}")); } } Err(error) => { - print_error(&format!("Error getting status: {}", error)); + print_error(&format!("Error getting status: {error}")); process::exit(1); } } @@ -615,13 +611,13 @@ fn main() { if error.kind == repo::RepoErrorKind::NotFound { print_error("Directory does not contain a git repository"); } else { - print_error(&format!("Opening repository failed: {}", error)); + print_error(&format!("Opening repository failed: {error}")); } process::exit(1); }); match repo.convert_to_worktree(&cwd) { - Ok(_) => print_success("Conversion done"), + Ok(()) => print_success("Conversion done"), Err(reason) => { match reason { repo::WorktreeConversionFailureReason::Changes => { @@ -631,7 +627,7 @@ fn main() { print_error("Ignored files found in repository, refusing to convert. Run git clean -f -d -X to remove them manually."); } repo::WorktreeConversionFailureReason::Error(error) => { - print_error(&format!("Error during conversion: {}", error)); + print_error(&format!("Error during conversion: {error}")); } } process::exit(1); @@ -643,7 +639,7 @@ fn main() { if error.kind == repo::RepoErrorKind::NotFound { print_error("Directory does not contain a git repository"); } else { - print_error(&format!("Opening repository failed: {}", error)); + print_error(&format!("Opening repository failed: {error}")); } process::exit(1); }); @@ -655,14 +651,14 @@ fn main() { } } Err(error) => { - print_error(&format!("Worktree cleanup failed: {}", error)); + print_error(&format!("Worktree cleanup failed: {error}")); process::exit(1); } } for unmanaged_worktree in repo.find_unmanaged_worktrees(&cwd).unwrap_or_else(|error| { - print_error(&format!("Failed finding unmanaged worktrees: {}", error)); + print_error(&format!("Failed finding unmanaged worktrees: {error}")); process::exit(1); }) { @@ -677,13 +673,13 @@ fn main() { if error.kind == repo::RepoErrorKind::NotFound { print_error("Directory does not contain a git repository"); } else { - print_error(&format!("Opening repository failed: {}", error)); + print_error(&format!("Opening repository failed: {error}")); } process::exit(1); }); repo.fetchall().unwrap_or_else(|error| { - print_error(&format!("Error fetching remotes: {}", error)); + print_error(&format!("Error fetching remotes: {error}")); process::exit(1); }); print_success("Fetched from all remotes"); @@ -693,25 +689,25 @@ fn main() { if error.kind == repo::RepoErrorKind::NotFound { print_error("Directory does not contain a git repository"); } else { - print_error(&format!("Opening repository failed: {}", error)); + print_error(&format!("Opening repository failed: {error}")); } process::exit(1); }); repo.fetchall().unwrap_or_else(|error| { - print_error(&format!("Error fetching remotes: {}", error)); + print_error(&format!("Error fetching remotes: {error}")); process::exit(1); }); let mut failures = false; for worktree in repo.get_worktrees().unwrap_or_else(|error| { - print_error(&format!("Error getting worktrees: {}", error)); + print_error(&format!("Error getting worktrees: {error}")); process::exit(1); }) { if let Some(warning) = worktree .forward_branch(args.rebase, args.stash) .unwrap_or_else(|error| { - print_error(&format!("Error updating worktree branch: {}", error)); + print_error(&format!("Error updating worktree branch: {error}")); process::exit(1); }) { @@ -734,25 +730,25 @@ fn main() { if error.kind == repo::RepoErrorKind::NotFound { print_error("Directory does not contain a git repository"); } else { - print_error(&format!("Opening repository failed: {}", error)); + print_error(&format!("Opening repository failed: {error}")); } process::exit(1); }); if args.pull { repo.fetchall().unwrap_or_else(|error| { - print_error(&format!("Error fetching remotes: {}", error)); + print_error(&format!("Error fetching remotes: {error}")); process::exit(1); }); } let config = repo::read_worktree_root_config(&cwd).unwrap_or_else(|error| { - print_error(&format!("Failed to read worktree configuration: {}", error)); + print_error(&format!("Failed to read worktree configuration: {error}")); process::exit(1); }); let worktrees = repo.get_worktrees().unwrap_or_else(|error| { - print_error(&format!("Error getting worktrees: {}", error)); + print_error(&format!("Error getting worktrees: {error}")); process::exit(1); }); @@ -764,8 +760,7 @@ fn main() { .forward_branch(args.rebase, args.stash) .unwrap_or_else(|error| { print_error(&format!( - "Error updating worktree branch: {}", - error + "Error updating worktree branch: {error}" )); process::exit(1); }) @@ -780,7 +775,7 @@ fn main() { if let Some(warning) = worktree .rebase_onto_default(&config, args.stash) .unwrap_or_else(|error| { - print_error(&format!("Error rebasing worktree branch: {}", error)); + print_error(&format!("Error rebasing worktree branch: {error}")); process::exit(1); }) { diff --git a/src/lib.rs b/src/lib.rs index 5029cbf..d5075c4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -43,10 +43,7 @@ fn find_repos( warnings.push(format!( "Error opening repo {}{}: {}", path.display(), - match is_worktree { - true => " as worktree", - false => "", - }, + if is_worktree { " as worktree" } else { "" }, error )); continue; @@ -65,8 +62,8 @@ fn find_repos( }; let mut results: Vec = Vec::new(); - for remote_name in remotes.iter() { - match repo.find_remote(remote_name)? { + for remote_name in remotes { + match repo.find_remote(&remote_name)? { Some(remote) => { let name = remote.name(); let url = remote.url(); @@ -118,10 +115,10 @@ fn find_repos( let name = path.strip_prefix(root).unwrap(); let namespace = name.parent().unwrap(); ( - if namespace != Path::new("") { - Some(path::path_as_string(namespace).to_string()) - } else { + if namespace == Path::new("") { None + } else { + Some(path::path_as_string(namespace).to_string()) }, path::path_as_string(name), ) diff --git a/src/output.rs b/src/output.rs index 3952249..9762a8f 100644 --- a/src/output.rs +++ b/src/output.rs @@ -1,7 +1,7 @@ use console::{Style, Term}; pub fn print_repo_error(repo: &str, message: &str) { - print_error(&format!("{}: {}", repo, message)); + print_error(&format!("{repo}: {message}")); } pub fn print_error(message: &str) { @@ -16,7 +16,7 @@ pub fn print_error(message: &str) { } pub fn print_repo_action(repo: &str, message: &str) { - print_action(&format!("{}: {}", repo, message)); + print_action(&format!("{repo}: {message}")); } pub fn print_action(message: &str) { @@ -42,7 +42,7 @@ pub fn print_warning(message: &str) { } pub fn print_repo_success(repo: &str, message: &str) { - print_success(&format!("{}: {}", repo, message)); + print_success(&format!("{repo}: {message}")); } pub fn print_success(message: &str) { diff --git a/src/path.rs b/src/path.rs index 7e004cc..03ea565 100644 --- a/src/path.rs +++ b/src/path.rs @@ -3,6 +3,42 @@ use std::process; use super::output::*; +pub fn path_as_string(path: &Path) -> String { + path.to_path_buf().into_os_string().into_string().unwrap() +} + +pub fn env_home() -> String { + match std::env::var("HOME") { + Ok(path) => path, + Err(error) => { + print_error(&format!("Unable to read HOME: {error}")); + process::exit(1); + } + } +} + +pub fn expand_path(path: &Path) -> PathBuf { + let expanded_path = match shellexpand::full_with_context( + &path_as_string(path), + || Some(env_home()), + |name| -> Result, &'static str> { + match name { + "HOME" => Ok(Some(env_home())), + _ => Ok(None), + } + }, + ) { + Ok(std::borrow::Cow::Borrowed(path)) => path.to_owned(), + Ok(std::borrow::Cow::Owned(path)) => path, + Err(error) => { + print_error(&format!("Unable to expand root: {error}")); + process::exit(1); + } + }; + + Path::new(&expanded_path).to_path_buf() +} + #[cfg(test)] mod tests { use super::*; @@ -42,39 +78,3 @@ mod tests { ); } } - -pub fn path_as_string(path: &Path) -> String { - path.to_path_buf().into_os_string().into_string().unwrap() -} - -pub fn env_home() -> String { - match std::env::var("HOME") { - Ok(path) => path, - Err(e) => { - print_error(&format!("Unable to read HOME: {}", e)); - process::exit(1); - } - } -} - -pub fn expand_path(path: &Path) -> PathBuf { - let expanded_path = match shellexpand::full_with_context( - &path_as_string(path), - || Some(env_home()), - |name| -> Result, &'static str> { - match name { - "HOME" => Ok(Some(env_home())), - _ => Ok(None), - } - }, - ) { - Ok(std::borrow::Cow::Borrowed(path)) => path.to_owned(), - Ok(std::borrow::Cow::Owned(path)) => path, - Err(e) => { - print_error(&format!("Unable to expand root: {}", e)); - process::exit(1); - } - }; - - Path::new(&expanded_path).to_path_buf() -} diff --git a/src/provider/gitlab.rs b/src/provider/gitlab.rs index b149c26..719c4dc 100644 --- a/src/provider/gitlab.rs +++ b/src/provider/gitlab.rs @@ -83,11 +83,10 @@ pub struct Gitlab { impl Gitlab { fn api_url(&self) -> String { - self.api_url_override - .as_ref() - .unwrap_or(&GITLAB_API_BASEURL.to_string()) - .trim_end_matches('/') - .to_string() + match self.api_url_override { + Some(ref s) => s.trim_end_matches('/').to_string(), + None => GITLAB_API_BASEURL.to_string(), + } } } diff --git a/src/provider/mod.rs b/src/provider/mod.rs index 384317c..219402f 100644 --- a/src/provider/mod.rs +++ b/src/provider/mod.rs @@ -79,7 +79,7 @@ pub struct Filter { impl Filter { pub fn new(users: Vec, groups: Vec, owner: bool, access: bool) -> Self { - Filter { + Self { users, groups, owner, @@ -104,8 +104,8 @@ impl From for ApiErrorResponse where T: JsonError, { - fn from(s: String) -> ApiErrorResponse { - ApiErrorResponse::String(s) + fn from(s: String) -> Self { + Self::String(s) } } @@ -176,7 +176,7 @@ pub trait Provider { Err(ureq::Error::Status(_code, response)) => { let r: Self::Error = response .into_json() - .map_err(|error| format!("Failed deserializing error response: {}", error))?; + .map_err(|error| format!("Failed deserializing error response: {error}"))?; return Err(ApiErrorResponse::Json(r)); } Ok(response) => { @@ -194,7 +194,7 @@ pub trait Provider { let result: Vec = response .into_json() - .map_err(|error| format!("Failed deserializing response: {}", error))?; + .map_err(|error| format!("Failed deserializing response: {error}"))?; results.extend(result); } @@ -331,12 +331,12 @@ where Err(ureq::Error::Status(_code, response)) => { let response: U = response .into_json() - .map_err(|error| format!("Failed deserializing error response: {}", error))?; + .map_err(|error| format!("Failed deserializing error response: {error}"))?; return Err(ApiErrorResponse::Json(response)); } Ok(response) => response .into_json() - .map_err(|error| format!("Failed deserializing response: {}", error))?, + .map_err(|error| format!("Failed deserializing response: {error}"))?, }; Ok(response) diff --git a/src/repo.rs b/src/repo.rs index 98a0fb5..7963095 100644 --- a/src/repo.rs +++ b/src/repo.rs @@ -31,6 +31,7 @@ pub enum WorktreeConversionFailureReason { Error(String), } +#[derive(Copy, Clone)] pub enum GitPushDefaultSetting { Upstream, } @@ -47,8 +48,8 @@ pub struct RepoError { } impl RepoError { - fn new(kind: RepoErrorKind) -> RepoError { - RepoError { kind } + fn new(kind: RepoErrorKind) -> Self { + Self { kind } } } @@ -132,7 +133,7 @@ impl Repo { } pub fn remove_namespace(&mut self) { - self.namespace = None + self.namespace = None; } } @@ -191,7 +192,7 @@ impl Worktree { pub fn forward_branch(&self, rebase: bool, stash: bool) -> Result, String> { let repo = RepoHandle::open(Path::new(&self.name), false) - .map_err(|error| format!("Error opening worktree: {}", error))?; + .map_err(|error| format!("Error opening worktree: {error}"))?; if let Ok(remote_branch) = repo.find_local_branch(&self.name)?.upstream() { let status = repo.status(false)?; @@ -244,7 +245,11 @@ impl Worktree { // Normal files are already staged, but changed submodules are not. let mut index = repo.0.index().map_err(convert_libgit2_error)?; index - .add_all(["."].iter(), git2::IndexAddOption::CHECK_PATHSPEC, None) + .add_all( + std::iter::once("."), + git2::IndexAddOption::CHECK_PATHSPEC, + None, + ) .map_err(convert_libgit2_error)?; if let Err(error) = rebase.commit(None, &committer, None) { @@ -295,13 +300,13 @@ impl Worktree { stash: bool, ) -> Result, String> { let repo = RepoHandle::open(Path::new(&self.name), false) - .map_err(|error| format!("Error opening worktree: {}", error))?; + .map_err(|error| format!("Error opening worktree: {error}"))?; let guess_default_branch = || { repo.default_branch() .map_err(|_| "Could not determine default branch")? .name() - .map_err(|error| format!("Failed getting default branch name: {}", error)) + .map_err(|error| format!("Failed getting default branch name: {error}")) }; let default_branch_name = match &config { @@ -368,7 +373,11 @@ impl Worktree { // Normal files are already staged, but changed submodules are not. let mut index = repo.0.index().map_err(convert_libgit2_error)?; index - .add_all(["."].iter(), git2::IndexAddOption::CHECK_PATHSPEC, None) + .add_all( + std::iter::once("."), + git2::IndexAddOption::CHECK_PATHSPEC, + None, + ) .map_err(convert_libgit2_error)?; if let Err(error) = rebase.commit(None, &committer, None) { @@ -398,109 +407,6 @@ impl RepoStatus { } } -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn check_ssh_remote() { - assert_eq!( - detect_remote_type("ssh://git@example.com"), - Ok(RemoteType::Ssh) - ); - assert_eq!(detect_remote_type("git@example.git"), Ok(RemoteType::Ssh)); - } - - #[test] - fn check_https_remote() { - assert_eq!( - detect_remote_type("https://example.com"), - Ok(RemoteType::Https) - ); - assert_eq!( - detect_remote_type("https://example.com/test.git"), - Ok(RemoteType::Https) - ); - } - - #[test] - fn check_file_remote() { - assert_eq!(detect_remote_type("file:///somedir"), Ok(RemoteType::File)); - } - - #[test] - fn check_invalid_remotes() { - assert_eq!( - detect_remote_type("https//example.com"), - Err(String::from( - "The remote URL starts with an unimplemented protocol" - )) - ); - assert_eq!( - detect_remote_type("https:example.com"), - Err(String::from( - "The remote URL starts with an unimplemented protocol", - )) - ); - assert_eq!( - detect_remote_type("ssh//example.com"), - Err(String::from( - "The remote URL starts with an unimplemented protocol", - )) - ); - assert_eq!( - detect_remote_type("ssh:example.com"), - Err(String::from( - "The remote URL starts with an unimplemented protocol", - )) - ); - assert_eq!( - detect_remote_type("git@example.com"), - Err(String::from( - "The remote URL starts with an unimplemented protocol", - )) - ); - } - - #[test] - fn check_unsupported_protocol_http() { - assert_eq!( - detect_remote_type("http://example.com"), - Err(String::from( - "Remotes using HTTP protocol are not supported", - )) - ); - } - - #[test] - fn check_unsupported_protocol_git() { - assert_eq!( - detect_remote_type("git://example.com"), - Err(String::from("Remotes using git protocol are not supported")) - ); - } - - #[test] - fn repo_check_fullname() { - let with_namespace = Repo { - name: "name".to_string(), - namespace: Some("namespace".to_string()), - worktree_setup: false, - remotes: None, - }; - - let without_namespace = Repo { - name: "name".to_string(), - namespace: None, - worktree_setup: false, - remotes: None, - }; - - assert_eq!(with_namespace.fullname(), "namespace/name"); - assert_eq!(without_namespace.fullname(), "name"); - } -} - pub fn detect_remote_type(remote_url: &str) -> Result { let git_regex = regex::Regex::new(r"^[a-zA-Z]+@.*$").unwrap(); if remote_url.starts_with("ssh://") { @@ -537,13 +443,15 @@ fn convert_libgit2_error(error: git2::Error) -> String { impl RepoHandle { pub fn open(path: &Path, is_worktree: bool) -> Result { - let open_func = match is_worktree { - true => Repository::open_bare, - false => Repository::open, + let open_func = if is_worktree { + Repository::open_bare + } else { + Repository::open }; - let path = match is_worktree { - true => path.join(worktree::GIT_MAIN_WORKTREE_DIRECTORY), - false => path.to_path_buf(), + let path = if is_worktree { + path.join(worktree::GIT_MAIN_WORKTREE_DIRECTORY) + } else { + path.to_path_buf() }; match open_func(path) { Ok(r) => Ok(Self(r)), @@ -567,7 +475,7 @@ impl RepoHandle { // Right now, we just open the repo AGAIN. It is safe, as we are only accessing the stash // with the second reference, so there are no cross effects. But it just smells. Also, // using `unwrap()` here as we are already sure that the repo is openable(?). - let mut repo = RepoHandle::open(self.0.path(), false).unwrap(); + let mut repo = Self::open(self.0.path(), false).unwrap(); repo.0 .stash_save2(&author, None, Some(git2::StashFlags::INCLUDE_UNTRACKED)) .map_err(convert_libgit2_error)?; @@ -575,7 +483,7 @@ impl RepoHandle { } pub fn stash_pop(&self) -> Result<(), String> { - let mut repo = RepoHandle::open(self.0.path(), false).unwrap(); + let mut repo = Self::open(self.0.path(), false).unwrap(); repo.0 .stash_pop( 0, @@ -721,13 +629,14 @@ impl RepoHandle { } pub fn init(path: &Path, is_worktree: bool) -> Result { - let repo = match is_worktree { - false => Repository::init(path).map_err(convert_libgit2_error)?, - true => Repository::init_bare(path.join(worktree::GIT_MAIN_WORKTREE_DIRECTORY)) - .map_err(convert_libgit2_error)?, + let repo = if is_worktree { + Repository::init_bare(path.join(worktree::GIT_MAIN_WORKTREE_DIRECTORY)) + .map_err(convert_libgit2_error)? + } else { + Repository::init(path).map_err(convert_libgit2_error)? }; - let repo = RepoHandle(repo); + let repo = Self(repo); if is_worktree { repo.set_config_push(GitPushDefaultSetting::Upstream)?; @@ -759,7 +668,7 @@ impl RepoHandle { Ok(Branch( self.0 .find_branch( - &format!("{}/{}", remote_name, branch_name), + &format!("{remote_name}/{branch_name}"), git2::BranchType::Remote, ) .map_err(convert_libgit2_error)?, @@ -787,7 +696,7 @@ impl RepoHandle { config .set_bool(GIT_CONFIG_BARE_KEY, value) - .map_err(|error| format!("Could not set {}: {}", GIT_CONFIG_BARE_KEY, error)) + .map_err(|error| format!("Could not set {GIT_CONFIG_BARE_KEY}: {error}")) } pub fn convert_to_worktree( @@ -811,18 +720,14 @@ impl RepoHandle { } std::fs::rename(".git", worktree::GIT_MAIN_WORKTREE_DIRECTORY).map_err(|error| { - WorktreeConversionFailureReason::Error(format!( - "Error moving .git directory: {}", - error - )) + WorktreeConversionFailureReason::Error(format!("Error moving .git directory: {error}",)) })?; for entry in match std::fs::read_dir(root_dir) { Ok(iterator) => iterator, Err(error) => { return Err(WorktreeConversionFailureReason::Error(format!( - "Opening directory failed: {}", - error + "Opening directory failed: {error}", ))); } } { @@ -836,40 +741,36 @@ impl RepoHandle { if path.is_file() || path.is_symlink() { if let Err(error) = std::fs::remove_file(&path) { return Err(WorktreeConversionFailureReason::Error(format!( - "Failed removing {}", - error + "Failed removing {error}", ))); } } else if let Err(error) = std::fs::remove_dir_all(&path) { return Err(WorktreeConversionFailureReason::Error(format!( - "Failed removing {}", - error + "Failed removing {error}", ))); } } Err(error) => { return Err(WorktreeConversionFailureReason::Error(format!( - "Error getting directory entry: {}", - error + "Error getting directory entry: {error}", ))); } } } - let worktree_repo = RepoHandle::open(root_dir, true).map_err(|error| { + let worktree_repo = Self::open(root_dir, true).map_err(|error| { WorktreeConversionFailureReason::Error(format!( - "Opening newly converted repository failed: {}", - error + "Opening newly converted repository failed: {error}", )) })?; worktree_repo .make_bare(true) - .map_err(|error| WorktreeConversionFailureReason::Error(format!("Error: {}", error)))?; + .map_err(|error| WorktreeConversionFailureReason::Error(format!("Error: {error}")))?; worktree_repo .set_config_push(GitPushDefaultSetting::Upstream) - .map_err(|error| WorktreeConversionFailureReason::Error(format!("Error: {}", error)))?; + .map_err(|error| WorktreeConversionFailureReason::Error(format!("Error: {error}")))?; Ok(()) } @@ -884,33 +785,28 @@ impl RepoHandle { GitPushDefaultSetting::Upstream => "upstream", }, ) - .map_err(|error| format!("Could not set {}: {}", GIT_CONFIG_PUSH_DEFAULT, error)) + .map_err(|error| format!("Could not set {GIT_CONFIG_PUSH_DEFAULT}: {error}")) } pub fn has_untracked_files(&self, is_worktree: bool) -> Result { - match is_worktree { - true => Err(String::from( + if is_worktree { + Err(String::from( "Cannot get changes as this is a bare worktree repository", - )), - false => { - let statuses = self - .0 - .statuses(Some(git2::StatusOptions::new().include_ignored(true))) - .map_err(convert_libgit2_error)?; + )) + } else { + let statuses = self + .0 + .statuses(Some(git2::StatusOptions::new().include_ignored(true))) + .map_err(convert_libgit2_error)?; - match statuses.is_empty() { - true => Ok(false), - false => { - for status in statuses.iter() { - let status_bits = status.status(); - if status_bits.intersects(git2::Status::IGNORED) { - return Ok(true); - } - } - Ok(false) - } + for status in statuses.iter() { + let status_bits = status.status(); + if status_bits.intersects(git2::Status::IGNORED) { + return Ok(true); } } + + Ok(false) } } @@ -931,101 +827,94 @@ impl RepoHandle { .map(|repo_name| repo_name.to_owned()) .collect::>(); - let head = match is_worktree { - true => None, - false => match empty { - true => None, - false => Some(self.head_branch()?.name()?), - }, + let head = if is_worktree || empty { + None + } else { + Some(self.head_branch()?.name()?) }; - let changes = match is_worktree { - true => None, - false => { - let statuses = self - .0 - .statuses(Some( - git2::StatusOptions::new() - .include_ignored(false) - .include_untracked(true), - )) - .map_err(convert_libgit2_error)?; + let changes = if is_worktree { + None + } else { + let statuses = self + .0 + .statuses(Some( + git2::StatusOptions::new() + .include_ignored(false) + .include_untracked(true), + )) + .map_err(convert_libgit2_error)?; - match statuses.is_empty() { - true => None, - false => { - let mut files_new = 0; - let mut files_modified = 0; - let mut files_deleted = 0; - for status in statuses.iter() { - let status_bits = status.status(); - if status_bits.intersects( - git2::Status::INDEX_MODIFIED - | git2::Status::INDEX_RENAMED - | git2::Status::INDEX_TYPECHANGE - | git2::Status::WT_MODIFIED - | git2::Status::WT_RENAMED - | git2::Status::WT_TYPECHANGE, - ) { - files_modified += 1; - } else if status_bits - .intersects(git2::Status::INDEX_NEW | git2::Status::WT_NEW) - { - files_new += 1; - } else if status_bits - .intersects(git2::Status::INDEX_DELETED | git2::Status::WT_DELETED) - { - files_deleted += 1; - } - } - if (files_new, files_modified, files_deleted) == (0, 0, 0) { - panic!( - "is_empty() returned true, but no file changes were detected. This is a bug!" - ); - } - Some(RepoChanges { - files_new, - files_modified, - files_deleted, - }) + if statuses.is_empty() { + None + } else { + let mut files_new = 0; + let mut files_modified = 0; + let mut files_deleted = 0; + for status in statuses.iter() { + let status_bits = status.status(); + if status_bits.intersects( + git2::Status::INDEX_MODIFIED + | git2::Status::INDEX_RENAMED + | git2::Status::INDEX_TYPECHANGE + | git2::Status::WT_MODIFIED + | git2::Status::WT_RENAMED + | git2::Status::WT_TYPECHANGE, + ) { + files_modified += 1; + } else if status_bits.intersects(git2::Status::INDEX_NEW | git2::Status::WT_NEW) + { + files_new += 1; + } else if status_bits + .intersects(git2::Status::INDEX_DELETED | git2::Status::WT_DELETED) + { + files_deleted += 1; } } + assert!( + (files_new, files_modified, files_deleted) != (0, 0, 0), + "is_empty() returned true, but no file changes were detected. This is a bug!" + ); + Some(RepoChanges { + files_new, + files_modified, + files_deleted, + }) } }; let worktrees = self.0.worktrees().unwrap().len(); - let submodules = match is_worktree { - true => None, - false => { - let mut submodules = Vec::new(); - for submodule in self.0.submodules().unwrap() { - let submodule_name = submodule.name().unwrap().to_string(); - - let submodule_status; - let status = self - .0 - .submodule_status(submodule.name().unwrap(), git2::SubmoduleIgnore::None) - .unwrap(); + let submodules = if is_worktree { + None + } else { + let mut submodules = Vec::new(); + for submodule in self.0.submodules().unwrap() { + let submodule_name = submodule.name().unwrap().to_string(); - if status.intersects( - git2::SubmoduleStatus::WD_INDEX_MODIFIED - | git2::SubmoduleStatus::WD_WD_MODIFIED - | git2::SubmoduleStatus::WD_UNTRACKED, - ) { - submodule_status = SubmoduleStatus::Changed; - } else if status.is_wd_uninitialized() { - submodule_status = SubmoduleStatus::Uninitialized; - } else if status.is_wd_modified() { - submodule_status = SubmoduleStatus::OutOfDate; - } else { - submodule_status = SubmoduleStatus::Clean; - } + let submodule_status; + let status = self + .0 + .submodule_status(submodule.name().unwrap(), git2::SubmoduleIgnore::None) + .unwrap(); - submodules.push((submodule_name, submodule_status)); + if status.intersects( + git2::SubmoduleStatus::WD_INDEX_MODIFIED + | git2::SubmoduleStatus::WD_WD_MODIFIED + | git2::SubmoduleStatus::WD_UNTRACKED, + ) { + submodule_status = SubmoduleStatus::Changed; + } else if status.is_wd_uninitialized() { + submodule_status = SubmoduleStatus::Uninitialized; + } else if status.is_wd_modified() { + submodule_status = SubmoduleStatus::OutOfDate; + } else { + submodule_status = SubmoduleStatus::Clean; } - Some(submodules) + + submodules.push((submodule_name, submodule_status)); } + Some(submodules) }; let mut branches = Vec::new(); @@ -1091,11 +980,11 @@ impl RepoHandle { if let Ok(remote_head) = self.find_remote_branch(remote_name, "HEAD") { if let Some(pointer_name) = remote_head.as_reference().symbolic_target() { if let Some(local_branch_name) = - pointer_name.strip_prefix(&format!("refs/remotes/{}/", remote_name)) + pointer_name.strip_prefix(&format!("refs/remotes/{remote_name}/")) { return Ok(Some(self.find_local_branch(local_branch_name)?)); } else { - eprintln!("Remote HEAD ({}) pointer is invalid", pointer_name); + eprintln!("Remote HEAD ({pointer_name}) pointer is invalid"); } } else { eprintln!("Remote HEAD does not point to a symbolic target"); @@ -1127,7 +1016,7 @@ impl RepoHandle { let mut default_branches: Vec = vec![]; for remote_name in remotes { if let Some(default_branch) = self.get_remote_default_branch(&remote_name)? { - default_branches.push(default_branch) + default_branches.push(default_branch); } } @@ -1195,26 +1084,24 @@ impl RepoHandle { if !fullpath.exists() { return Err(WorktreeRemoveFailureReason::Error(format!( - "{} does not exist", - name + "{name} does not exist", ))); } - let worktree_repo = RepoHandle::open(&fullpath, false).map_err(|error| { - WorktreeRemoveFailureReason::Error(format!("Error opening repo: {}", error)) + let worktree_repo = Self::open(&fullpath, false).map_err(|error| { + WorktreeRemoveFailureReason::Error(format!("Error opening repo: {error}")) })?; let local_branch = worktree_repo.head_branch().map_err(|error| { - WorktreeRemoveFailureReason::Error(format!("Failed getting head branch: {}", error)) + WorktreeRemoveFailureReason::Error(format!("Failed getting head branch: {error}")) })?; let branch_name = local_branch.name().map_err(|error| { - WorktreeRemoveFailureReason::Error(format!("Failed getting name of branch: {}", error)) + WorktreeRemoveFailureReason::Error(format!("Failed getting name of branch: {error}")) })?; if branch_name != name { return Err(WorktreeRemoveFailureReason::Error(format!( - "Branch \"{}\" is checked out in worktree \"{}\", this does not look correct", - &branch_name, + "Branch \"{branch_name}\" is checked out in worktree \"{}\", this does not look correct", &worktree_dir.display(), ))); } @@ -1256,8 +1143,7 @@ impl RepoHandle { if has_persistent_branches && !is_merged_into_persistent_branch { return Err(WorktreeRemoveFailureReason::NotMerged(format!( - "Branch {} is not merged into any persistent branches", - name + "Branch {name} is not merged into any persistent branches", ))); } @@ -1270,15 +1156,13 @@ impl RepoHandle { if (ahead, behind) != (0, 0) { return Err(WorktreeRemoveFailureReason::Changes(format!( - "Branch {} is not in line with remote branch", - name + "Branch {name} is not in line with remote branch", ))); } } Err(_) => { return Err(WorktreeRemoveFailureReason::Changes(format!( - "No remote tracking branch for branch {} found", - name + "No remote tracking branch for branch {name} found", ))); } } @@ -1339,7 +1223,7 @@ impl RepoHandle { let worktrees = self .get_worktrees() - .map_err(|error| format!("Getting worktrees failed: {}", error))?; + .map_err(|error| format!("Getting worktrees failed: {error}"))?; let config = read_worktree_root_config(directory)?; @@ -1347,7 +1231,7 @@ impl RepoHandle { self.default_branch() .map_err(|_| "Could not determine default branch")? .name() - .map_err(|error| format!("Failed getting default branch name: {}", error)) + .map_err(|error| format!("Failed getting default branch name: {error}")) }; let default_branch_name = match &config { @@ -1384,7 +1268,7 @@ impl RepoHandle { false, &config, ) { - Ok(_) => print_success(&format!("Worktree {} deleted", &worktree.name())), + Ok(()) => print_success(&format!("Worktree {} deleted", &worktree.name())), Err(error) => match error { WorktreeRemoveFailureReason::Changes(changes) => { warnings.push(format!( @@ -1416,7 +1300,7 @@ impl RepoHandle { pub fn find_unmanaged_worktrees(&self, directory: &Path) -> Result, String> { let worktrees = self .get_worktrees() - .map_err(|error| format!("Getting worktrees failed: {}", error))?; + .map_err(|error| format!("Getting worktrees failed: {error}"))?; let mut unmanaged_worktrees = Vec::new(); for entry in std::fs::read_dir(directory).map_err(|error| error.to_string())? { @@ -1434,9 +1318,9 @@ impl RepoHandle { let guess_default_branch = || { self.default_branch() - .map_err(|error| format!("Failed getting default branch: {}", error))? + .map_err(|error| format!("Failed getting default branch: {error}"))? .name() - .map_err(|error| format!("Failed getting default branch name: {}", error)) + .map_err(|error| format!("Failed getting default branch name: {error}")) }; let default_branch_name = match &config { @@ -1529,7 +1413,7 @@ impl<'a> Branch<'a> { pub fn set_upstream(&mut self, remote_name: &str, branch_name: &str) -> Result<(), String> { self.0 - .set_upstream(Some(&format!("{}/{}", remote_name, branch_name))) + .set_upstream(Some(&format!("{remote_name}/{branch_name}"))) .map_err(convert_libgit2_error)?; Ok(()) } @@ -1579,9 +1463,8 @@ fn get_remote_callbacks() -> git2::RemoteCallbacks<'static> { }); callbacks.credentials(|_url, username_from_url, _allowed_types| { - let username = match username_from_url { - Some(username) => username, - None => panic!("Could not get username. This is a bug"), + let Some(username) = username_from_url else { + panic!("Could not get username. This is a bug") }; git2::Cred::ssh_key_from_agent(username) }); @@ -1637,10 +1520,8 @@ impl RemoteHandle<'_> { let mut push_options = git2::PushOptions::new(); push_options.remote_callbacks(get_remote_callbacks()); - let push_refspec = format!( - "+refs/heads/{}:refs/heads/{}", - local_branch_name, remote_branch_name - ); + let push_refspec = + format!("+refs/heads/{local_branch_name}:refs/heads/{remote_branch_name}",); self.0 .push(&[push_refspec], Some(&mut push_options)) .map_err(|error| { @@ -1661,9 +1542,10 @@ pub fn clone_repo( path: &Path, is_worktree: bool, ) -> Result<(), Box> { - let clone_target = match is_worktree { - false => path.to_path_buf(), - true => path.join(worktree::GIT_MAIN_WORKTREE_DIRECTORY), + let clone_target = if is_worktree { + path.join(worktree::GIT_MAIN_WORKTREE_DIRECTORY) + } else { + path.to_path_buf() }; print_action(&format!( @@ -1734,3 +1616,106 @@ pub fn clone_repo( Ok(()) } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn check_ssh_remote() { + assert_eq!( + detect_remote_type("ssh://git@example.com"), + Ok(RemoteType::Ssh) + ); + assert_eq!(detect_remote_type("git@example.git"), Ok(RemoteType::Ssh)); + } + + #[test] + fn check_https_remote() { + assert_eq!( + detect_remote_type("https://example.com"), + Ok(RemoteType::Https) + ); + assert_eq!( + detect_remote_type("https://example.com/test.git"), + Ok(RemoteType::Https) + ); + } + + #[test] + fn check_file_remote() { + assert_eq!(detect_remote_type("file:///somedir"), Ok(RemoteType::File)); + } + + #[test] + fn check_invalid_remotes() { + assert_eq!( + detect_remote_type("https//example.com"), + Err(String::from( + "The remote URL starts with an unimplemented protocol" + )) + ); + assert_eq!( + detect_remote_type("https:example.com"), + Err(String::from( + "The remote URL starts with an unimplemented protocol", + )) + ); + assert_eq!( + detect_remote_type("ssh//example.com"), + Err(String::from( + "The remote URL starts with an unimplemented protocol", + )) + ); + assert_eq!( + detect_remote_type("ssh:example.com"), + Err(String::from( + "The remote URL starts with an unimplemented protocol", + )) + ); + assert_eq!( + detect_remote_type("git@example.com"), + Err(String::from( + "The remote URL starts with an unimplemented protocol", + )) + ); + } + + #[test] + fn check_unsupported_protocol_http() { + assert_eq!( + detect_remote_type("http://example.com"), + Err(String::from( + "Remotes using HTTP protocol are not supported", + )) + ); + } + + #[test] + fn check_unsupported_protocol_git() { + assert_eq!( + detect_remote_type("git://example.com"), + Err(String::from("Remotes using git protocol are not supported")) + ); + } + + #[test] + fn repo_check_fullname() { + let with_namespace = Repo { + name: "name".to_string(), + namespace: Some("namespace".to_string()), + worktree_setup: false, + remotes: None, + }; + + let without_namespace = Repo { + name: "name".to_string(), + namespace: None, + worktree_setup: false, + remotes: None, + }; + + assert_eq!(with_namespace.fullname(), "namespace/name"); + assert_eq!(without_namespace.fullname(), "name"); + } +} diff --git a/src/table.rs b/src/table.rs index 357b1ba..c565af7 100644 --- a/src/table.rs +++ b/src/table.rs @@ -31,28 +31,26 @@ fn add_repo_status( table.add_row([ repo_name, - match is_worktree { - true => "\u{2714}", - false => "", - }, - &match is_worktree { - true => String::from(""), - false => match repo_status.changes { + if is_worktree { "\u{2714}" } else { "" }, + &if is_worktree { + String::new() + } else { + match repo_status.changes { Some(changes) => { let mut out = Vec::new(); if changes.files_new > 0 { - out.push(format!("New: {}\n", changes.files_new)) + out.push(format!("New: {}\n", changes.files_new)); } if changes.files_modified > 0 { - out.push(format!("Modified: {}\n", changes.files_modified)) + out.push(format!("Modified: {}\n", changes.files_modified)); } if changes.files_deleted > 0 { - out.push(format!("Deleted: {}\n", changes.files_deleted)) + out.push(format!("Deleted: {}\n", changes.files_deleted)); } out.into_iter().collect::().trim().to_string() } None => String::from("\u{2714}"), - }, + } }, repo_status .branches @@ -84,12 +82,13 @@ fn add_repo_status( s }) .trim(), - &match is_worktree { - true => String::from(""), - false => match repo_status.head { + &if is_worktree { + String::new() + } else { + match repo_status.head { Some(head) => head, None => String::from("Empty"), - }, + } }, repo_status .remotes @@ -224,30 +223,30 @@ fn add_worktree_status( let local_branch = repo .head_branch() - .map_err(|error| format!("Failed getting head branch: {}", error))?; + .map_err(|error| format!("Failed getting head branch: {error}"))?; let upstream_output = match local_branch.upstream() { Ok(remote_branch) => { let remote_branch_name = remote_branch .name() - .map_err(|error| format!("Failed getting name of remote branch: {}", error))?; + .map_err(|error| format!("Failed getting name of remote branch: {error}"))?; let (ahead, behind) = repo .graph_ahead_behind(&local_branch, &remote_branch) - .map_err(|error| format!("Failed computing branch deviation: {}", error))?; + .map_err(|error| format!("Failed computing branch deviation: {error}"))?; format!( "{}{}\n", &remote_branch_name, &match (ahead, behind) { - (0, 0) => String::from(""), + (0, 0) => String::new(), (d, 0) => format!(" [+{}]", &d), (0, d) => format!(" [-{}]", &d), (d1, d2) => format!(" [+{}/-{}]", &d1, &d2), }, ) } - Err(_) => String::from(""), + Err(_) => String::new(), }; table.add_row([ @@ -256,13 +255,13 @@ fn add_worktree_status( Some(changes) => { let mut out = Vec::new(); if changes.files_new > 0 { - out.push(format!("New: {}\n", changes.files_new)) + out.push(format!("New: {}\n", changes.files_new)); } if changes.files_modified > 0 { - out.push(format!("Modified: {}\n", changes.files_modified)) + out.push(format!("Modified: {}\n", changes.files_modified)); } if changes.files_deleted > 0 { - out.push(format!("Deleted: {}\n", changes.files_deleted)) + out.push(format!("Deleted: {}\n", changes.files_deleted)); } out.into_iter().collect::().trim().to_string() } @@ -270,7 +269,7 @@ fn add_worktree_status( }, &local_branch .name() - .map_err(|error| format!("Failed getting name of branch: {}", error))?, + .map_err(|error| format!("Failed getting name of branch: {error}"))?, &upstream_output, ]); @@ -289,11 +288,11 @@ pub fn show_single_repo_status( let repo_handle = repo::RepoHandle::open(path, is_worktree); if let Err(error) = repo_handle { - if error.kind == repo::RepoErrorKind::NotFound { - return Err(String::from("Directory is not a git directory")); + return if error.kind == repo::RepoErrorKind::NotFound { + Err(String::from("Directory is not a git directory")) } else { - return Err(format!("Opening repository failed: {}", error)); - } + Err(format!("Opening repository failed: {error}")) + }; }; let repo_name = match path.file_name() { diff --git a/src/tree.rs b/src/tree.rs index d31e4fe..b1ab00d 100644 --- a/src/tree.rs +++ b/src/tree.rs @@ -50,7 +50,7 @@ pub fn sync_trees(config: config::Config, init_worktree: bool) -> Result print_repo_success(&repo.name, "OK"), + Ok(()) => print_repo_success(&repo.name, "OK"), Err(error) => { print_repo_error(&repo.name, &error); failures = true; @@ -60,14 +60,14 @@ pub fn sync_trees(config: config::Config, init_worktree: bool) -> Result { - for path in repos.into_iter() { + for path in repos { if !unmanaged_repos_absolute_paths.contains(&path) { unmanaged_repos_absolute_paths.push(path); } } } Err(error) => { - print_error(&format!("Error getting unmanaged repos: {}", error)); + print_error(&format!("Error getting unmanaged repos: {error}")); failures = true; } } @@ -117,8 +117,8 @@ pub fn find_repo_paths(path: &Path) -> Result, String> { } } } - Err(e) => { - return Err(format!("Error accessing directory: {}", e)); + Err(error) => { + return Err(format!("Error accessing directory: {error}")); } }; } @@ -189,19 +189,19 @@ fn sync_repo(root_path: &Path, repo: &repo::Repo, init_worktree: bool) -> Result print_repo_success(&repo.name, "Repository created"); Some(r) } - Err(e) => { - return Err(format!("Repository failed during init: {}", e)); + Err(error) => { + return Err(format!("Repository failed during init: {error}")); } }; } else { let first = repo.remotes.as_ref().unwrap().first().unwrap(); match repo::clone_repo(first, &repo_path, repo.worktree_setup) { - Ok(_) => { + Ok(()) => { print_repo_success(&repo.name, "Repository successfully cloned"); } - Err(e) => { - return Err(format!("Repository failed during clone: {}", e)); + Err(error) => { + return Err(format!("Repository failed during clone: {error}")); } }; @@ -211,12 +211,12 @@ fn sync_repo(root_path: &Path, repo: &repo::Repo, init_worktree: bool) -> Result let repo_handle = match repo::RepoHandle::open(&repo_path, repo.worktree_setup) { Ok(repo) => repo, Err(error) => { - if !repo.worktree_setup && repo::RepoHandle::open(&repo_path, true).is_ok() { - return Err(String::from( + return if !repo.worktree_setup && repo::RepoHandle::open(&repo_path, true).is_ok() { + Err(String::from( "Repo already exists, but is using a worktree setup", - )); + )) } else { - return Err(format!("Opening repository failed: {}", error)); + Err(format!("Opening repository failed: {error}")) } } }; @@ -235,7 +235,7 @@ fn sync_repo(root_path: &Path, repo: &repo::Repo, init_worktree: bool) -> Result if let Some(remotes) = &repo.remotes { let current_remotes: Vec = repo_handle .remotes() - .map_err(|error| format!("Repository failed during getting the remotes: {}", error))?; + .map_err(|error| format!("Repository failed during getting the remotes: {error}"))?; for remote in remotes { let current_remote = repo_handle.find_remote(&remote.name)?; @@ -262,10 +262,9 @@ fn sync_repo(root_path: &Path, repo: &repo::Repo, init_worktree: bool) -> Result &remote.name, &remote.url ), ); - if let Err(e) = repo_handle.new_remote(&remote.name, &remote.url) { + if let Err(error) = repo_handle.new_remote(&remote.name, &remote.url) { return Err(format!( - "Repository failed during setting the remotes: {}", - e + "Repository failed during setting the remotes: {error}", )); } } @@ -291,8 +290,9 @@ fn sync_repo(root_path: &Path, repo: &repo::Repo, init_worktree: bool) -> Result } fn get_actual_git_directory(path: &Path, is_worktree: bool) -> PathBuf { - match is_worktree { - false => path.to_path_buf(), - true => path.join(worktree::GIT_MAIN_WORKTREE_DIRECTORY), + if is_worktree { + path.join(worktree::GIT_MAIN_WORKTREE_DIRECTORY) + } else { + path.to_path_buf() } } diff --git a/src/worktree.rs b/src/worktree.rs index f5396ff..5fe6540 100644 --- a/src/worktree.rs +++ b/src/worktree.rs @@ -77,7 +77,7 @@ //! * There is `origin/prefix/foobar` and `remote2/foobar`, with different //! states //! * You set `track.default_prefix = "prefix"` (and no default remote!) -//! * You run `grm worktree add `prefix/foobar` +//! * You run `grm worktree add prefix/foobar` //! * Instead of just picking `origin/prefix/foobar`, grm will complain because //! it also selected `remote2/foobar`. //! @@ -154,7 +154,7 @@ //! * The new branch is created with all the required settings //! //! Don't worry about the lifetime stuff: There is only one single lifetime, as -//! everything (branches, commits) is derived from the single repo::Repo +//! everything (branches, commits) is derived from the single `repo::Repo` //! instance //! //! # Testing @@ -209,26 +209,10 @@ use std::cell::RefCell; use std::path::Path; -// use super::output::*; use super::repo; pub const GIT_MAIN_WORKTREE_DIRECTORY: &str = ".git-main-working-tree"; -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn invalid_worktree_names() { - assert!(add_worktree(Path::new("/tmp/"), "/leadingslash", None, false).is_err()); - assert!(add_worktree(Path::new("/tmp/"), "trailingslash/", None, false).is_err()); - assert!(add_worktree(Path::new("/tmp/"), "//", None, false).is_err()); - assert!(add_worktree(Path::new("/tmp/"), "test//test", None, false).is_err()); - assert!(add_worktree(Path::new("/tmp/"), "test test", None, false).is_err()); - assert!(add_worktree(Path::new("/tmp/"), "test\ttest", None, false).is_err()); - } -} - struct Init; struct WithLocalBranchName<'a> { @@ -261,7 +245,7 @@ struct Worktree<'a, S: WorktreeState> { extra: S, } -impl<'a> WithLocalBranchName<'a> { +impl WithLocalBranchName<'_> { fn new(name: String) -> Self { Self { local_branch_name: name, @@ -273,9 +257,9 @@ impl<'a> WithLocalBranchName<'a> { trait WorktreeState {} impl WorktreeState for Init {} -impl<'a> WorktreeState for WithLocalBranchName<'a> {} -impl<'a> WorktreeState for WithLocalTargetSelected<'a> {} -impl<'a> WorktreeState for WithRemoteTrackingBranch<'a> {} +impl WorktreeState for WithLocalBranchName<'_> {} +impl WorktreeState for WithLocalTargetSelected<'_> {} +impl WorktreeState for WithRemoteTrackingBranch<'_> {} impl<'a> Worktree<'a, Init> { fn new(repo: &'a repo::RepoHandle) -> Self { @@ -416,9 +400,8 @@ impl<'a> Worktree<'a, WithRemoteTrackingBranch<'a>> { branch.set_upstream(&remote_name, &remote_branch.basename()?)?; } None => { - let mut remote = match self.repo.find_remote(&remote_name)? { - Some(remote) => remote, - None => return Err(format!("Remote \"{remote_name}\" not found")), + let Some(mut remote) = self.repo.find_remote(&remote_name)? else { + return Err(format!("Remote \"{remote_name}\" not found")); }; if !remote.is_pushable()? { @@ -430,13 +413,13 @@ impl<'a> Worktree<'a, WithRemoteTrackingBranch<'a>> { if let Some(prefix) = self.extra.prefix { remote.push( &self.extra.local_branch_name, - &format!("{}/{}", prefix, remote_branch_name), + &format!("{prefix}/{remote_branch_name}"), self.repo, )?; branch.set_upstream( &remote_name, - &format!("{}/{}", prefix, remote_branch_name), + &format!("{prefix}/{remote_branch_name}"), )?; } else { remote.push( @@ -543,22 +526,19 @@ impl<'a> Worktree<'a, WithRemoteTrackingBranch<'a>> { fn validate_worktree_name(name: &str) -> Result<(), String> { if name.starts_with('/') || name.ends_with('/') { return Err(format!( - "Invalid worktree name: {}. It cannot start or end with a slash", - name + "Invalid worktree name: {name}. It cannot start or end with a slash", )); } if name.contains("//") { return Err(format!( - "Invalid worktree name: {}. It cannot contain two consecutive slashes", - name + "Invalid worktree name: {name}. It cannot contain two consecutive slashes", )); } if name.contains(char::is_whitespace) { return Err(format!( - "Invalid worktree name: {}. It cannot contain whitespace", - name + "Invalid worktree name: {name}. It cannot contain whitespace", )); } @@ -583,7 +563,7 @@ pub fn add_worktree( repo::RepoErrorKind::NotFound => { String::from("Current directory does not contain a worktree setup") } - _ => format!("Error opening repo: {}", error), + repo::RepoErrorKind::Unknown(_) => format!("Error opening repo: {error}"), })?; let remotes = &repo.remotes()?; @@ -591,7 +571,7 @@ pub fn add_worktree( let config = repo::read_worktree_root_config(directory)?; if repo.find_worktree(name).is_ok() { - return Err(format!("Worktree {} already exists", &name)); + return Err(format!("Worktree {name} already exists")); } let track_config = config.and_then(|config| config.track); @@ -654,7 +634,7 @@ pub fn add_worktree( } _ => { let commit = if let Some(ref default_remote) = default_remote { - if let Some(ref prefix) = prefix { + if let Some(prefix) = prefix { if let Ok(remote_branch) = repo .find_remote_branch(default_remote, &format!("{prefix}/{name}")) { @@ -678,9 +658,9 @@ pub fn add_worktree( None }.or({ let mut commits = vec![]; - for remote_name in remotes.iter() { + for remote_name in remotes { let remote_head: Option> = ({ - if let Some(ref prefix) = prefix { + if let Some(prefix) = prefix { if let Ok(remote_branch) = repo.find_remote_branch( remote_name, &format!("{prefix}/{name}"), @@ -778,3 +758,18 @@ pub fn add_worktree( Some(warnings) }) } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn invalid_worktree_names() { + assert!(add_worktree(Path::new("/tmp/"), "/leadingslash", None, false).is_err()); + assert!(add_worktree(Path::new("/tmp/"), "trailingslash/", None, false).is_err()); + assert!(add_worktree(Path::new("/tmp/"), "//", None, false).is_err()); + assert!(add_worktree(Path::new("/tmp/"), "test//test", None, false).is_err()); + assert!(add_worktree(Path::new("/tmp/"), "test test", None, false).is_err()); + assert!(add_worktree(Path::new("/tmp/"), "test\ttest", None, false).is_err()); + } +} From 6d93faed7e3821e4edb9c29667bf1e58f67dde0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Sun, 10 Nov 2024 12:47:07 +0100 Subject: [PATCH 02/20] arch: Fix linking failures in PKGBUILD --- pkg/arch/PKGBUILD | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/arch/PKGBUILD b/pkg/arch/PKGBUILD index d8a27c3..31a73e3 100644 --- a/pkg/arch/PKGBUILD +++ b/pkg/arch/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Hannes Körber pkgname='grm-git' -pkgver=0.7.15.r6.gea7299a -pkgrel=2 +pkgver=0.7.21.r1.gfcd315b +pkgrel=1 pkgdesc='Manage git repos, worktrees and integrate with GitHub and GitLab' arch=('x86_64') url='https://github.com/hakoerber/git-repo-manager' @@ -12,6 +12,8 @@ provides=('grm') conflicts=('grm') source=("${pkgname}::git+https://github.com/hakoerber/git-repo-manager#branch=develop") sha256sums=('SKIP') + # https://gitlab.archlinux.org/archlinux/packaging/packages/pacman/-/issues/20 +options=(!lto !debug) pkgver() { cd "${pkgname}" @@ -29,8 +31,6 @@ build() { export RUSTUP_TOOLCHAIN=stable export CARGO_TARGET_DIR=target export GRM_RELEASE_VERSION="${pkgver}" - # https://gitlab.archlinux.org/archlinux/packaging/packages/pacman/-/issues/20 - export CFLAGS+=' -ffat-lto-objects' cargo build --frozen --release } From b2c504081089a1c89c8561ed45eb521fb56ef03e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Sun, 10 Nov 2024 12:48:26 +0100 Subject: [PATCH 03/20] arch: Update SRCINFO --- pkg/arch/.SRCINFO | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/arch/.SRCINFO b/pkg/arch/.SRCINFO index 54e2cae..a62258c 100644 --- a/pkg/arch/.SRCINFO +++ b/pkg/arch/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = grm-git pkgdesc = Manage git repos, worktrees and integrate with GitHub and GitLab - pkgver = 0.7.15.r6.gea7299a - pkgrel = 2 + pkgver = 0.7.21.r1.gfcd315b + pkgrel = 1 url = https://github.com/hakoerber/git-repo-manager arch = x86_64 license = GPL-3.0-only @@ -14,6 +14,8 @@ pkgbase = grm-git depends = openssl provides = grm conflicts = grm + options = !lto + options = !debug source = grm-git::git+https://github.com/hakoerber/git-repo-manager#branch=develop sha256sums = SKIP From fc59796c451b30d1acd6edcf27aa1468fb890d86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Sat, 30 Nov 2024 14:37:11 +0100 Subject: [PATCH 04/20] Add script to update AUR PKGBUILD --- update-pkgbuild.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 update-pkgbuild.sh diff --git a/update-pkgbuild.sh b/update-pkgbuild.sh new file mode 100755 index 0000000..dd8b430 --- /dev/null +++ b/update-pkgbuild.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +if ! git remote | grep -q ^aur$; then + git remote add aur ssh://aur@aur.archlinux.org/grm-git.git +fi + +git subtree push --prefix pkg/arch/ aur master + +git remote rm aur From 9fcd63acb445c01f6bbf5fc4923d1835e2f82e8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Sat, 30 Nov 2024 14:37:52 +0100 Subject: [PATCH 05/20] dep: Update dependencies of toml --- Cargo.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bedb564..fffd9d5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -332,9 +332,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.1" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "heck" @@ -728,9 +728,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.89" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -1008,9 +1008,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "2.0.87" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -1094,9 +1094,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-width" From 156a382db7174075b7c506aa42664522a57d2bc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Sat, 30 Nov 2024 14:37:55 +0100 Subject: [PATCH 06/20] dep: Update serde to 1.0.215 --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fffd9d5..ba3faf0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -890,18 +890,18 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 0932560..7c269b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,7 +46,7 @@ path = "src/grm/main.rs" version = "=0.8.19" [dependencies.serde] -version = "=1.0.214" +version = "=1.0.215" features = ["derive"] [dependencies.git2] From 63535ebf014e3172af9880f5deefb4c14af5bc4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Sat, 30 Nov 2024 14:37:56 +0100 Subject: [PATCH 07/20] dep: Update dependencies of git2 --- Cargo.lock | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ba3faf0..387c071 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -98,9 +98,9 @@ checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "cc" -version = "1.1.35" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f57c4b4da2a9d619dd035f27316d7a426305b75be93d09e92f2b9229c34feaf" +checksum = "f34d93e62b03caf570cccc334cbc6c2fceca82f39211051345108adcba3eebdc" dependencies = [ "jobserver", "libc", @@ -531,9 +531,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.161" +version = "0.2.167" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" +checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" [[package]] name = "libgit2-sys" @@ -587,9 +587,9 @@ dependencies = [ [[package]] name = "litemap" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" [[package]] name = "lock_api" @@ -636,9 +636,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "300.4.0+3.4.0" +version = "300.4.1+3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a709e02f2b4aca747929cca5ed248880847c650233cf8b8cdc48f40aaf4898a6" +checksum = "faa4eac4138c62414b5622d1b31c5c304f34b406b013c079c2bbc652fdd6678c" dependencies = [ "cc", ] @@ -1136,9 +1136,9 @@ dependencies = [ [[package]] name = "url" -version = "2.5.3" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", @@ -1396,9 +1396,9 @@ checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" [[package]] name = "yoke" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" dependencies = [ "serde", "stable_deref_trait", @@ -1408,9 +1408,9 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", @@ -1441,18 +1441,18 @@ dependencies = [ [[package]] name = "zerofrom" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", From fdfbc8ebafda0b57f2481fbb4726d55d800667e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Sat, 30 Nov 2024 14:37:59 +0100 Subject: [PATCH 08/20] dep: Update dependencies of shellexpand --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 387c071..e98f094 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1030,18 +1030,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.68" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02dd99dc800bbb97186339685293e1cc5d9df1f8fae2d0aecd9ff1c77efea892" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.68" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7c61ec9a6f64d2793d8a45faba21efbe3ced62a886d44c36a009b2b519b4c7e" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", From e414cec6f7c043896767278962e6ce400b94a956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Sat, 30 Nov 2024 14:38:01 +0100 Subject: [PATCH 09/20] dep: Update clap to 4.5.21 --- Cargo.lock | 12 ++++++------ Cargo.toml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e98f094..6715bfa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -115,9 +115,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.20" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" +checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" dependencies = [ "clap_builder", "clap_derive", @@ -125,9 +125,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.20" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" +checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" dependencies = [ "anstream", "anstyle", @@ -149,9 +149,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" [[package]] name = "colorchoice" diff --git a/Cargo.toml b/Cargo.toml index 7c269b7..dd7fd27 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -56,7 +56,7 @@ version = "=0.19.0" version = "=3.1.0" [dependencies.clap] -version = "=4.5.20" +version = "=4.5.21" features = ["derive", "cargo"] [dependencies.console] From b33f9f563e238a769f5a77ff50251068ef011d4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Sat, 30 Nov 2024 14:38:03 +0100 Subject: [PATCH 10/20] dep: Update dependencies of regex --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6715bfa..c9eba64 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -808,9 +808,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", From fb2a287c48a3fc6f12838c90d4264f4d01cc48c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Sat, 30 Nov 2024 14:38:06 +0100 Subject: [PATCH 11/20] dep: Update comfy-table to 7.1.3 --- Cargo.lock | 49 ++++++++++++++++++++++++++++++++++++++++++------- Cargo.toml | 2 +- 2 files changed, 43 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c9eba64..7fa33fb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -161,14 +161,14 @@ checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "comfy-table" -version = "7.1.1" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b34115915337defe99b2aff5c2ce6771e5fbc4079f4b506301f5cf394c8452f7" +checksum = "24f165e7b643266ea80cb858aed492ad9280e3e05ce24d4a99d7d7b889b6a4d9" dependencies = [ "crossterm", "strum", "strum_macros", - "unicode-width", + "unicode-width 0.2.0", ] [[package]] @@ -180,7 +180,7 @@ dependencies = [ "encode_unicode", "lazy_static", "libc", - "unicode-width", + "unicode-width 0.1.14", "windows-sys 0.52.0", ] @@ -195,14 +195,14 @@ dependencies = [ [[package]] name = "crossterm" -version = "0.27.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" +checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" dependencies = [ "bitflags", "crossterm_winapi", - "libc", "parking_lot", + "rustix", "winapi", ] @@ -259,6 +259,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + [[package]] name = "flate2" version = "1.0.34" @@ -585,6 +595,12 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + [[package]] name = "litemap" version = "0.7.4" @@ -838,6 +854,19 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rustix" +version = "0.38.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + [[package]] name = "rustls" version = "0.23.16" @@ -1104,6 +1133,12 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" + [[package]] name = "unsafe-libyaml" version = "0.2.11" diff --git a/Cargo.toml b/Cargo.toml index dd7fd27..56bc74d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -66,7 +66,7 @@ version = "=0.15.8" version = "=1.11.1" [dependencies.comfy-table] -version = "=7.1.1" +version = "=7.1.3" [dependencies.serde_yaml] version = "=0.9.34" From ca05e5315e904ffce7e604bc1de39bf48ce3ef30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Sat, 30 Nov 2024 14:38:08 +0100 Subject: [PATCH 12/20] dep: Update dependencies of serde_yaml --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7fa33fb..853165b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -520,9 +520,9 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "jobserver" From 38bcd736bd2b45f350abe21f8edf60ed69b64250 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Sat, 30 Nov 2024 14:38:10 +0100 Subject: [PATCH 13/20] dep: Update serde_json to 1.0.133 --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 853165b..fc084c5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -939,9 +939,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.132" +version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ "itoa", "memchr", diff --git a/Cargo.toml b/Cargo.toml index 56bc74d..8bf2e2f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -72,7 +72,7 @@ version = "=7.1.3" version = "=0.9.34" [dependencies.serde_json] -version = "=1.0.132" +version = "=1.0.133" [dependencies.ureq] version = "=2.10.1" From 6f0db6e8e1d8703b16bbbafb9148d2489cf10bb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Sat, 30 Nov 2024 14:38:12 +0100 Subject: [PATCH 14/20] dep: Update ureq to 2.11.0 --- Cargo.lock | 31 +++++++++++++++++-------------- Cargo.toml | 2 +- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fc084c5..4ec2dcd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -271,9 +271,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.34" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", "miniz_oxide", @@ -603,9 +603,9 @@ checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "litemap" -version = "0.7.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" [[package]] name = "lock_api" @@ -869,9 +869,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.16" +version = "0.23.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee87ff5d9b36712a58574e12e9f0ea80f915a5b0ac518d322b24a465617925e" +checksum = "934b404430bb06b3fae2cba809eb45a1ab1aecd64491213d7c3301b88393f8d1" dependencies = [ "log", "once_cell", @@ -1153,12 +1153,13 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "2.10.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b74fc6b57825be3373f7054754755f03ac3a8f5d70015ccad699ba2029956f4a" +checksum = "b30e6f97efe1fa43535ee241ee76967d3ff6ff3953ebb430d8d55c5393029e7b" dependencies = [ "base64", "flate2", + "litemap", "log", "once_cell", "rustls", @@ -1167,6 +1168,8 @@ dependencies = [ "serde_json", "url", "webpki-roots", + "yoke", + "zerofrom", ] [[package]] @@ -1231,9 +1234,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "webpki-roots" -version = "0.26.6" +version = "0.26.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +checksum = "5d642ff16b7e79272ae451b7322067cdc17cadf68c23264be9d94a32319efe7e" dependencies = [ "rustls-pki-types", ] @@ -1431,9 +1434,9 @@ checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" [[package]] name = "yoke" -version = "0.7.5" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" dependencies = [ "serde", "stable_deref_trait", @@ -1476,9 +1479,9 @@ dependencies = [ [[package]] name = "zerofrom" -version = "0.1.5" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" dependencies = [ "zerofrom-derive", ] diff --git a/Cargo.toml b/Cargo.toml index 8bf2e2f..d6d334f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -75,7 +75,7 @@ version = "=0.9.34" version = "=1.0.133" [dependencies.ureq] -version = "=2.10.1" +version = "=2.11.0" features = ["json"] [dependencies.parse_link_header] From b6fcc97ab39b8373a776ff13ec8b89f05de63eb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Sat, 30 Nov 2024 14:38:13 +0100 Subject: [PATCH 15/20] dep: Update dependencies of parse_link_header --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4ec2dcd..14cf2e1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -92,9 +92,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "cc" From b667f74648c6da1fdfe93c9da0be4ab5f84686ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Sat, 30 Nov 2024 14:39:39 +0100 Subject: [PATCH 16/20] dep: Update dependencies of clap --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 14cf2e1..e284427 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -266,7 +266,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] From 44a123ec5e03d6b48e25b215e622a505b9c42643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Sat, 30 Nov 2024 14:39:40 +0100 Subject: [PATCH 17/20] dep: Update dependencies of console --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index e284427..14cf2e1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -266,7 +266,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] From d843c00c6f0354d5cce05928fc008faa5749bf37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Sat, 30 Nov 2024 16:27:44 +0100 Subject: [PATCH 18/20] dep: Update dependencies of clap --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 14cf2e1..e284427 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -266,7 +266,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] From 2c58c9d3b748f99ed7a5a4ae9337ed16d8551b9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Sat, 30 Nov 2024 16:27:45 +0100 Subject: [PATCH 19/20] dep: Update dependencies of console --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index e284427..14cf2e1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -266,7 +266,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] From 5b15baa5650c286f3e6fe23a053105092a757232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Sat, 30 Nov 2024 16:37:10 +0100 Subject: [PATCH 20/20] Release v0.7.22 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 14cf2e1..da6acc0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -307,7 +307,7 @@ dependencies = [ [[package]] name = "git-repo-manager" -version = "0.7.21" +version = "0.7.22" dependencies = [ "clap", "comfy-table", diff --git a/Cargo.toml b/Cargo.toml index d6d334f..3e14795 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "git-repo-manager" -version = "0.7.21" +version = "0.7.22" edition = "2021" authors = [