From ffc9741d1e716d8b292b1d858d7352db354ace96 Mon Sep 17 00:00:00 2001 From: SidneyZhang Date: Mon, 2 Feb 2026 14:50:12 +0800 Subject: [PATCH] =?UTF-8?q?refactor(git):=20=E7=A7=BB=E9=99=A4=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E7=9A=84=20git=20commit=20=E5=91=BD=E4=BB=A4=E5=B9=B6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20tempfile=20=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/git/mod.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/git/mod.rs b/src/git/mod.rs index 48ffd18..3442b58 100644 --- a/src/git/mod.rs +++ b/src/git/mod.rs @@ -2,6 +2,7 @@ use anyhow::{bail, Context, Result}; use git2::{Repository, Signature, StatusOptions, Config, Oid, ObjectType}; use std::path::{Path, PathBuf}; use std::collections::HashMap; +use tempfile; pub mod changelog; pub mod commit; @@ -367,11 +368,6 @@ impl GitRepo { let temp_file = tempfile::NamedTempFile::new()?; std::fs::write(temp_file.path(), message)?; - let mut cmd = std::process::Command::new("git"); - cmd.args(&["commit", "-S", "-F", temp_file.path().to_str().unwrap()]) - .current_dir(&self.path) - .output()?; - let output = std::process::Command::new("git") .args(&["commit", "-S", "-F", temp_file.path().to_str().unwrap()]) .current_dir(&self.path)