mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-06 08:18:58 +00:00
Simplify git add pathspec building by hoisting common arg
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
314ee9be99
commit
9b842c49d5
1 changed files with 3 additions and 8 deletions
|
|
@ -149,14 +149,9 @@ pub fn checkpoint_commit(
|
|||
tracing::debug!(path = %work_dir.display(), node_id, "Creating git checkpoint commit");
|
||||
// Stage everything (with optional excludes)
|
||||
let mut cmd = git_cmd(work_dir);
|
||||
cmd.args(["add", "-A", "--"]);
|
||||
if excludes.is_empty() {
|
||||
cmd.arg(".");
|
||||
} else {
|
||||
cmd.arg(".");
|
||||
for glob in excludes {
|
||||
cmd.arg(format!(":(glob,exclude){glob}"));
|
||||
}
|
||||
cmd.args(["add", "-A", "--", "."]);
|
||||
for glob in excludes {
|
||||
cmd.arg(format!(":(glob,exclude){glob}"));
|
||||
}
|
||||
let output = cmd
|
||||
.output()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue