hk 1.45.0

A tool for managing git hooks
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::Result;
use crate::hook_options::HookOptions;

#[derive(clap::Args)]
pub struct PostMerge {
    /// Flag indicating whether the merge was a squash merge (1) or not (0)
    is_squash: String,
    #[clap(flatten)]
    hook: HookOptions,
}

impl PostMerge {
    pub async fn run(mut self) -> Result<()> {
        self.hook.tctx.insert("hook_args", &self.is_squash);
        self.hook.run("post-merge").await
    }
}