Add repo rename command

This commit is contained in:
Joscha 2025-05-03 16:29:50 +02:00
parent 357de970ee
commit 3390526522
4 changed files with 32 additions and 3 deletions

View file

@ -13,8 +13,8 @@ pub use crate::repo::VERSION as REPO_VERSION;
pub use self::{
datadir::{LockedDataDir, UnlockedDataDir},
v1::{
State, VERSION, add_repo, load_repo, load_repo_version, load_state, remove_repo, save_repo,
select_repo, tidy,
State, VERSION, add_repo, load_repo, load_repo_version, load_state, remove_repo,
rename_repo, save_repo, select_repo, tidy,
},
};

View file

@ -111,7 +111,7 @@ pub fn remove_repo(dir: &LockedDataDir, id: RepoId) -> anyhow::Result<()> {
Ok(())
}
pub fn set_repo_name(dir: &LockedDataDir, id: RepoId, name: String) -> anyhow::Result<()> {
pub fn rename_repo(dir: &LockedDataDir, id: RepoId, name: String) -> anyhow::Result<()> {
let mut state = load_state(dir)?;
*state
.repos