refactor: rename name to repo_alias for consistency

This commit is contained in:
Paul Campbell 2024-04-23 06:50:52 +01:00
parent 32d54cfc1c
commit 8b56a185d3
4 changed files with 6 additions and 6 deletions

View file

@ -111,7 +111,7 @@ pub async fn register(
let url = network::NetUrl::new(format!( let url = network::NetUrl::new(format!(
"https://{hostname}/api/v1/repos/{repo_path}/hooks?token={token}" "https://{hostname}/api/v1/repos/{repo_path}/hooks?token={token}"
)); ));
let repo_alias = &repo_details.name; let repo_alias = &repo_details.repo_alias;
let headers = network::NetRequestHeaders::new().with("Content-Type", "application/json"); let headers = network::NetRequestHeaders::new().with("Content-Type", "application/json");
let authorisation = WebhookAuth::generate(); let authorisation = WebhookAuth::generate();
let body = json!({ let body = json!({

View file

@ -322,7 +322,7 @@ impl Deref for BranchName {
/// The derived information about a repo, used to interact with it /// The derived information about a repo, used to interact with it
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub struct RepoDetails { pub struct RepoDetails {
pub name: RepoAlias, pub repo_alias: RepoAlias,
pub repo_path: RepoPath, pub repo_path: RepoPath,
pub branch: BranchName, pub branch: BranchName,
pub forge: ForgeDetails, pub forge: ForgeDetails,
@ -337,7 +337,7 @@ impl RepoDetails {
forge: &ForgeConfig, forge: &ForgeConfig,
) -> Self { ) -> Self {
Self { Self {
name: name.clone(), repo_alias: name.clone(),
repo_path: RepoPath(server_repo_config.repo.clone()), repo_path: RepoPath(server_repo_config.repo.clone()),
repo_config: server_repo_config.repo_config(), repo_config: server_repo_config.repo_config(),
branch: BranchName(server_repo_config.branch.clone()), branch: BranchName(server_repo_config.branch.clone()),
@ -369,7 +369,7 @@ impl Display for RepoDetails {
f, f,
"{}/{} ({}): {}:{}/{} @ {}", "{}/{} ({}): {}:{}/{} @ {}",
self.forge.name, self.forge.name,
self.name, self.repo_alias,
self.forge.forge_type, self.forge.forge_type,
self.forge.hostname, self.forge.hostname,
self.forge.user, self.forge.user,

View file

@ -15,7 +15,7 @@ pub fn clone(repo_details: &RepoDetails, gitdir: GitDir) -> Result<(), RepoClone
gitdir gitdir
) )
.into(); .into();
let repo_name = &repo_details.name; let repo_name = &repo_details.repo_alias;
info!("Cloning {repo_name} to {gitdir}"); info!("Cloning {repo_name} to {gitdir}");
match gix::command::prepare(command.expose_secret()) match gix::command::prepare(command.expose_secret())
.with_shell_allow_argument_splitting() .with_shell_allow_argument_splitting()

View file

@ -35,7 +35,7 @@ pub fn repo_details(
gitdir: Option<GitDir>, gitdir: Option<GitDir>,
) -> RepoDetails { ) -> RepoDetails {
RepoDetails { RepoDetails {
name: repo_alias(n), repo_alias: repo_alias(n),
repo_path: repo_path(n), repo_path: repo_path(n),
gitdir, gitdir,
branch: branch_name(n), branch: branch_name(n),