commit_wizard/adapters/git/
noop.rs

1use crate::ports::git::{CommitOptions, GitPort};
2use anyhow::Result;
3
4#[derive(Default)]
5pub struct NoopGit;
6
7impl GitPort for NoopGit {
8    fn commit(&self, message: &str, opts: &CommitOptions) -> Result<()> {
9        println!("---[commit-wizard] (dry-run) ---------------------");
10        println!("{message}");
11        if opts.allow_empty {
12            println!("(note) --allow-empty requested");
13        }
14        println!(
15            "(noop) Would run: git commit -F <msgfile>{}",
16            " if allow-empty".replace(
17                " if allow-empty",
18                if opts.allow_empty {
19                    " --allow-empty"
20                } else {
21                    ""
22                }
23            )
24        );
25        Ok(())
26    }
27}