git-gamble 2.12.1

blend TDD + TCR to make sure to develop the right thing 😌, baby step by baby step πŸ‘ΆπŸ¦Ά
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::process::ExitStatus;

use super::cli::Cli;
use super::commit::commit;
use super::gamble_result::GambleResult;
use super::repository::Repository;
use super::revert::revert;

type RepositoryCommand = fn(opt: &Cli, repository: &Repository) -> GambleResult;

pub(crate) fn tcr(status: ExitStatus) -> RepositoryCommand {
	if status.success() { commit } else { revert }
}

pub(crate) fn trc(status: ExitStatus) -> RepositoryCommand {
	if status.success() { revert } else { commit }
}