MCPcopy Create free account
hub / github.com/alt-art/commit / main

Function main

src/main.rs:46–75  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44}
45
46fn main() -> Result<()> {
47 let args = Args::parse();
48
49 if args.all {
50 git_add_all_modified()?;
51 }
52
53 check_staged_files()?;
54
55 let pattern = config::get_pattern(args.config)?;
56
57 if args.retry {
58 let commit_message = read_cached_commit()?;
59 pre_commit_check(pattern.config.pre_commit, &commit_message)?;
60 commit(&commit_message)?;
61 return Ok(());
62 }
63
64 let commit_message = make_message_commit(pattern.clone())?;
65 write_cached_commit(&commit_message)?;
66
67 pre_commit_check(pattern.config.pre_commit, &commit_message)?;
68
69 if args.hook {
70 return Ok(());
71 }
72
73 commit(&commit_message)?;
74 Ok(())
75}

Callers

nothing calls this directly

Calls 8

git_add_all_modifiedFunction · 0.85
check_staged_filesFunction · 0.85
get_patternFunction · 0.85
read_cached_commitFunction · 0.85
pre_commit_checkFunction · 0.85
commitFunction · 0.85
make_message_commitFunction · 0.85
write_cached_commitFunction · 0.85

Tested by

no test coverage detected