rsmultigit 0.1.15

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::commands::count::is_ahead;
use crate::subprocess_utils::check_call;

/// Push the current branch to origin. Skips repos not ahead of remote.
pub fn do_push(project: &Path) -> Result<bool> {
    if !is_ahead(project)? {
        return Ok(false);
    }
    check_call(project, "git", &["push"])?;
    Ok(true)
}