pub struct GitAutoInit {
pub default_branch: String,
}Expand description
Runs git init -b <branch> + git config receive.denyCurrentBranch updateInstead in the pod directory at provisioning time.
Mirrors JSS tryAutoInitRepo (#466/#469/#471).
§Usage
use std::path::PathBuf;
use solid_pod_rs_git::init::GitAutoInit;
use solid_pod_rs::provision::{provision_pod_ext, ProvisionPlan};
// storage is any type implementing solid_pod_rs::storage::Storage
// (e.g. FsBackend with feature "fs-backend").
let plan = ProvisionPlan {
pubkey: "abcd1234".into(),
display_name: None,
pod_base: "https://pods.example".into(),
containers: vec![],
root_acl: None,
quota_bytes: None,
};
let hook = GitAutoInit::new();
let fs_root = PathBuf::from("/var/lib/pods/abcd1234");
provision_pod_ext(&storage, &plan, Some((&hook, fs_root.as_path()))).await.unwrap();Fields§
§default_branch: StringBranch name passed to git init -b. JSS uses main; configurable
here so agentbox / VisionClaw can override to trunk etc. if
desired.
Implementations§
Source§impl GitAutoInit
impl GitAutoInit
Source§impl GitAutoInit
impl GitAutoInit
Sourcepub async fn init_repo_at(&self, fs_pod_root: &Path) -> Result<(), GitError>
pub async fn init_repo_at(&self, fs_pod_root: &Path) -> Result<(), GitError>
Initialise a git repository at fs_pod_root (git init -b <branch> +
receive.denyCurrentBranch updateInstead), returning a git-crate-native
GitError on failure.
This is the single canonical init implementation — the
GitInitHook::try_init_repo trait method (provisioning-time) and the
on-demand auto-init in crate::service::GitHttpService::handle (first
push) both delegate here, so there is exactly one place that shells
git init. Idempotent: re-running on an existing repo is safe (git
reinitialises in place). Mirrors JSS tryAutoInitRepo (#466/#469/#472).
Trait Implementations§
Source§impl Clone for GitAutoInit
impl Clone for GitAutoInit
Source§fn clone(&self) -> GitAutoInit
fn clone(&self) -> GitAutoInit
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more