1#![doc = include_str!("../README.md")]
2
3#[doc(hidden)]
22#[macro_export]
23macro_rules! flag_methods {
24 (
25 $(#[$attr:meta])*
26 $vis:vis fn $name:ident / $name_if:ident, $field:ident, $doc_if:literal
27 ) => {
28 $(#[$attr])*
29 #[must_use]
30 $vis fn $name(self) -> Self {
31 self.$name_if(true)
32 }
33
34 #[doc = $doc_if]
35 #[must_use]
36 $vis fn $name_if(mut self, value: bool) -> Self {
37 self.$field = value;
38 self
39 }
40 };
41}
42
43pub mod add;
44pub mod branch;
45pub mod clone;
46pub mod commit;
47pub mod config;
48pub mod fetch;
49pub mod init;
50pub mod ls_remote;
51pub mod push;
52pub mod remote;
53pub mod rev_list;
54pub mod rev_parse;
55pub mod show;
56pub mod show_ref;
57pub mod status;
58pub mod url;
59pub mod worktree;
60
61use std::path::Path;
62
63pub use cmd_proc::CommandError;
64
65fn base_command(repo_path: Option<&Path>) -> cmd_proc::Command {
70 cmd_proc::Command::new("git").optional_option("-C", repo_path)
71}