git-gamble 2.14.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
use std::path::Path;

use crate::git_gamble::gamble_result::GambleResult;
use crate::git_gamble::repository::Repository;

use super::cli::SubCommandHook;

pub fn handle_hook(repository_path: &Path, hook_options: &SubCommandHook) -> GambleResult<()> {
	let repository = Repository::new(repository_path, false, false);
	match hook_options {
		SubCommandHook::Enable { hook } => repository.enable_hook(hook),
		SubCommandHook::Disable { hook } => repository.disable_hook(hook),
	}
}