refactor(#2285): drop coordinator 1:1 path accessors, callers use paths:: directly

This commit is contained in:
damocles 2026-07-10 20:18:27 +02:00 committed by mara
commit cfb84b420a
13 changed files with 38 additions and 56 deletions

View file

@ -7,8 +7,6 @@ use anyhow::Context;
use forgejo_api::ForgejoError;
use forgejo_api::structs::{MergePullRequestOption, MergePullRequestOptionDo};
use crate::coordinator::Coordinator;
use super::{CONFIG_ORG, api, core_token, forge_git_url};
// ---------------------------------------------------------------------------
@ -133,7 +131,7 @@ pub async fn fetch_pr_head_into_applied(repo: &str, pr: u64) -> Result<(), Forge
let token = core_token()
.ok_or_else(|| ForgeMergeError::Other(anyhow::anyhow!("forge core token absent")))?;
let url = forge_git_url(&token, repo);
let applied = Coordinator::agent_applied_dir(repo_agent_name(repo));
let applied = crate::paths::applied_dir(repo_agent_name(repo));
let refspec = format!("refs/pull/{pr}/head");
let out = crate::lifecycle::git_command()
.current_dir(&applied)
@ -165,7 +163,7 @@ pub async fn ff_push_to_main(repo: &str, sha: &str) -> Result<(), ForgeMergeErro
let token = core_token()
.ok_or_else(|| ForgeMergeError::Other(anyhow::anyhow!("forge core token absent")))?;
let url = forge_git_url(&token, repo);
let applied = Coordinator::agent_applied_dir(repo_agent_name(repo));
let applied = crate::paths::applied_dir(repo_agent_name(repo));
// Current `main` on the forge repo.
let ls = crate::lifecycle::git_command()

View file

@ -360,7 +360,7 @@ pub async fn push_config(name: &str) -> Result<()> {
let Some(token) = core_token() else {
return Ok(());
};
let dir = Coordinator::agent_applied_dir(name);
let dir = crate::paths::applied_dir(name);
if !dir.join(".git").exists() {
return Ok(());
}