Skip to content
Snippets Groups Projects
Commit 69174638 authored by nfontrod's avatar nfontrod
Browse files

src/create_hooks.rs: add co alias in .git/config

parent c32df47c
Branches
No related tags found
No related merge requests found
......@@ -43,7 +43,6 @@ fn get_hooks_folder() -> PathBuf {
p
}
/// Function used to create a file
///
/// # Arguments:
......@@ -84,7 +83,6 @@ fn create_file(folder: &PathBuf, file_name: &str, content: &str) {
});
}
/// Add a gblkco alias in `.git/config` file at the end to ensure a quiet
/// Checkout and a quiet cancel of this checkout
fn update_config_file() {
......@@ -100,7 +98,7 @@ fn update_config_file() {
.append(true)
.open(&git_config)
.unwrap();
writeln!(file, "[alias]\n\tgblkco = checkout -q").unwrap();
writeln!(file, "[alias]\n\tco = checkout -q").unwrap();
}
/// Create 2 files in `.git/hooks` folder
......@@ -121,7 +119,7 @@ pub fn create_hooks(compression: &str, mode: &str) {
original_commit=${{arr[5]}} \n\
target_commit=${{arr[7]}} \n\
\n
git -c core.hooksPath=/dev/null gblkco ${{original_commit}} && gblk pre-co && git -c core.hooksPath=/dev/null checkout ${{target_commit}} && gblk co --mode {}
git -c core.hooksPath=/dev/null co ${{original_commit}} && gblk pre-co && git -c core.hooksPath=/dev/null checkout ${{target_commit}} && gblk checkout --mode {}
", mode);
let post_co_cmd = post_co_cmd.as_str();
let v = vec![post_commit_cmd, post_co_cmd];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment