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
Trait Implementations§
Source§impl Clone for GitAutoInit
impl Clone for GitAutoInit
Source§fn clone(&self) -> GitAutoInit
fn clone(&self) -> GitAutoInit
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GitAutoInit
impl Debug for GitAutoInit
Source§impl Default for GitAutoInit
impl Default for GitAutoInit
Source§impl GitInitHook for GitAutoInit
impl GitInitHook for GitAutoInit
Source§fn try_init_repo<'life0, 'life1, 'async_trait>(
&'life0 self,
fs_pod_root: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<(), PodError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn try_init_repo<'life0, 'life1, 'async_trait>(
&'life0 self,
fs_pod_root: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<(), PodError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Called with the absolute filesystem path of the freshly provisioned
pod directory. Errors are logged and swallowed — a git-init
failure must not roll back or prevent pod creation.
Auto Trait Implementations§
impl Freeze for GitAutoInit
impl RefUnwindSafe for GitAutoInit
impl Send for GitAutoInit
impl Sync for GitAutoInit
impl Unpin for GitAutoInit
impl UnsafeUnpin for GitAutoInit
impl UnwindSafe for GitAutoInit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more