second-brain-adapters 0.13.5

Conversation parsers for second-brain: Claude Code and Cursor JSONL adapters
Documentation
use std::process::Command;

use second_brain_adapters::git::Checkout;

#[test]
fn missing_git_binary_is_an_error_or_none() {
    let tmp = tempfile::tempdir().unwrap();
    let out = Command::new("git")
        .arg("-C")
        .arg(tmp.path())
        .args(["init", "-q"])
        .output()
        .unwrap();
    assert!(out.status.success());
    let checkout = Checkout::containing(tmp.path()).unwrap();

    // SAFETY: this binary holds a single test, so no other thread reads the environment.
    unsafe { std::env::set_var("PATH", tmp.path().join("no-bin")) };

    assert!(checkout.head().is_err());
    assert!(checkout.commits_since(None, 10).is_err());
    assert_eq!(checkout.github_remote(), None);
    assert_eq!(Checkout::containing(tmp.path()), None);
}