Radish alpha
r
Radicle CI broker
Radicle
Git (anonymous pull)
Log in to clone via SSH
refactor: rename variables for clarity
Lars Wirzenius committed 1 year ago
commit c69c4c44ca3166a5af0ffc8d778cd19e8dfbd22d
parent b1820f3c2adbcb8523ed5085557c5739cbe4914f
1 file changed +11 -10
modified 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),