From c69c4c44ca3166a5af0ffc8d778cd19e8dfbd22d Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 18 Jun 2024 20:18:45 +0300 Subject: [PATCH] refactor: rename variables for clarity Signed-off-by: Lars Wirzenius --- src/msg.rs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/msg.rs b/src/msg.rs index 2a4e3eb4..d6908236 100644 --- a/src/msg.rs +++ b/src/msg.rs @@ -133,17 +133,18 @@ impl<'a> RequestBuilder<'a> { old, } => (rid, name, oid, old), }; - let repository = profile.storage.repository(*rid)?; + + let rad_repo = profile.storage.repository(*rid)?; let storage = &profile.storage; - let repo = radicle_surf::Repository::open(paths::repository(storage, rid))?; - let repo_project = repository.project()?; + let git_repo = radicle_surf::Repository::open(paths::repository(storage, rid))?; + let project_info = rad_repo.project()?; let msg_repository = Repository { id: *rid, - name: repo_project.name().to_string(), - description: repo_project.description().to_string(), - private: !repository.identity()?.visibility.is_public(), - default_branch: repo_project.default_branch().to_string(), - delegates: repository.delegates()?.iter().copied().collect(), + name: project_info.name().to_string(), + description: project_info.description().to_string(), + private: !rad_repo.identity()?.visibility.is_public(), + default_branch: project_info.default_branch().to_string(), + delegates: rad_repo.delegates()?.iter().copied().collect(), }; let author = match extract_author(profile, event) { @@ -163,7 +164,7 @@ impl<'a> RequestBuilder<'a> { }, push: None, patch: Some( - self.build_trigger_from_patch(event, repository, &repo, profile, author)?, + self.build_trigger_from_patch(event, rad_repo, &git_repo, profile, author)?, ), }), Some(ParsedRef::Push(_branch)) => Ok(Request::Trigger { @@ -173,7 +174,7 @@ impl<'a> RequestBuilder<'a> { repository: msg_repository, }, push: Some(self.build_trigger_from_push( - repo, + git_repo, author, name, old.unwrap_or(*oid),