(
&self,
command: Either<String, GitCommandOptions>,
subcommand: Option<String>,
name: Option<String>,
path: Option<String>,
new_branch: Option<bool>,
| 3865 | ts_args_type = "command: string | GitCommandOptions, subcommand?: string | null, name?: string | null, path?: string | null, newBranch?: boolean | null, base?: string | null, force?: boolean | null, maxCount?: number | null, message?: string | null, includeUntracked?: boolean | null, target?: string | null, reference?: string | null" |
| 3866 | )] |
| 3867 | pub async fn git( |
| 3868 | &self, |
| 3869 | command: Either<String, GitCommandOptions>, |
| 3870 | subcommand: Option<String>, |
| 3871 | name: Option<String>, |
| 3872 | path: Option<String>, |
| 3873 | new_branch: Option<bool>, |
| 3874 | base: Option<String>, |
| 3875 | force: Option<bool>, |
| 3876 | max_count: Option<u32>, |
| 3877 | message: Option<String>, |
| 3878 | include_untracked: Option<bool>, |
| 3879 | target: Option<String>, |
| 3880 | reference: Option<String>, |
| 3881 | ) -> napi::Result<ToolResult> { |
| 3882 | let mut args = match command { |
| 3883 | Either::A(command) => serde_json::json!({ "command": command }), |
| 3884 | Either::B(options) => git_command_options_to_args(options), |
| 3885 | }; |
| 3886 | |
| 3887 | if args.is_object() { |
| 3888 | if let Some(sc) = subcommand { |
| 3889 | args["subcommand"] = serde_json::json!(sc); |
| 3890 | } |
| 3891 | if let Some(n) = name { |
| 3892 | args["name"] = serde_json::json!(n); |
| 3893 | } |
| 3894 | if let Some(p) = path { |
| 3895 | args["path"] = serde_json::json!(p); |
| 3896 | } |
| 3897 | if let Some(nb) = new_branch { |
| 3898 | args["new_branch"] = serde_json::json!(nb); |
| 3899 | } |
| 3900 | if let Some(b) = base { |
| 3901 | args["base"] = serde_json::json!(b); |
| 3902 | } |
| 3903 | if let Some(f) = force { |
| 3904 | args["force"] = serde_json::json!(f); |
| 3905 | } |
| 3906 | if let Some(mc) = max_count { |
| 3907 | args["max_count"] = serde_json::json!(mc); |
| 3908 | } |
| 3909 | if let Some(msg) = message { |
| 3910 | args["message"] = serde_json::json!(msg); |
| 3911 | } |
| 3912 | if let Some(iu) = include_untracked { |
| 3913 | args["include_untracked"] = serde_json::json!(iu); |
| 3914 | } |
| 3915 | if let Some(t) = target { |
| 3916 | args["target"] = serde_json::json!(t); |
| 3917 | } |
| 3918 | if let Some(r) = reference { |
| 3919 | args["ref"] = serde_json::json!(r); |
| 3920 | } |
| 3921 | } |
| 3922 | |
| 3923 | let session = self.inner.clone(); |
| 3924 | let result = get_runtime() |
no test coverage detected