rsmultigit 0.1.17

Manage multiple git repositories at once
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::path::Path;

use anyhow::Result;

use crate::subprocess_utils::capture_output;

/// Show the age of the last commit as a human-readable relative date.
pub fn do_age(project: &Path) -> Result<Option<String>> {
    let output = capture_output(project, "git", &["log", "-1", "--format=%cr"])?;
    if output.is_empty() {
        Ok(None)
    } else {
        Ok(Some(output))
    }
}