eazygit 0.5.1

A fast TUI for Git with staging, conflicts, rebase, and palette-first UX
Documentation
//! Git-specific effect handlers.
//!
//! This module provides convenience wrappers for Git operations
//! that can be used by the effect executor.

use std::path::Path;

/// Git operation utilities for effect execution.
pub struct GitEffects;

impl GitEffects {
    /// Check if a path is a valid Git repository.
    pub fn is_git_repo(path: &Path) -> bool {
        path.join(".git").exists()
    }
    
    /// Get the repository root from a path within it.
    pub fn repo_root(path: &Path) -> Option<String> {
        let mut current = path.to_path_buf();
        while !current.join(".git").exists() {
            if !current.pop() {
                return None;
            }
        }
        Some(current.to_string_lossy().to_string())
    }
}