gitbit 0.1.0

A lightweight Git automation tool that generates commit messages from diffs using AI (Gemini).
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::process::Command;

pub fn is_git_repo() -> bool {
    Command::new("git")
        .args(["rev-parse", "--is-inside-work-tree"])
        .output()
        .map(|o| o.status.success())
        .unwrap_or(false)
}

pub fn has_commits() -> bool {
    let result = Command::new("git")
        .args(["rev-parse", "HEAD"])
        .output();

    result.map(|o| o.status.success()).unwrap_or(false)
}