gitpoulpi-cli-backend 1.0.0

GitBackend implementation that shells out to the system `git` binary, parsing only machine-readable output (porcelain v2, NUL-delimited logs).
Documentation
//! Stand-in for `worktrees.rs` when the `worktree` feature is off (custom
//! builds): the same signatures, every operation answers
//! `NotBuilt { feature: "worktree" }`. The internal "checked out elsewhere"
//! guard reads `worktree_list` instead, which is always compiled.

use std::path::Path;

use gitpoulpi_core::domain::{
    RepoRef, Worktree, WorktreeAddOptions, WorktreeChange, WorktreeRemoveOptions, WorktreeRemoved,
};
use gitpoulpi_core::{Error, Result};

fn not_built<T>() -> Result<T> {
    Err(Error::NotBuilt {
        feature: "worktree",
    })
}

pub fn worktrees(_repo: &RepoRef) -> Result<Vec<Worktree>> {
    not_built()
}

pub fn worktree_add(_repo: &RepoRef, _path: &Path, _opts: &WorktreeAddOptions) -> Result<Worktree> {
    not_built()
}

pub fn worktree_changes(_repo: &RepoRef, _path: &Path) -> Result<Vec<WorktreeChange>> {
    not_built()
}

pub fn worktree_remove(
    _repo: &RepoRef,
    _path: &Path,
    _opts: &WorktreeRemoveOptions,
) -> Result<WorktreeRemoved> {
    not_built()
}