refactor: rename variables for clarity

Signed-off-by: Lars Wirzenius <liw@liw.fi>
This commit is contained in:
Lars Wirzenius
2024-06-18 20:36:22 +03:00
parent b1820f3c2a
commit c69c4c44ca
+11 -10
View File
@@ -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),