From 9b842c49d55db8a5ac4cece41e0693590ff85174 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Sat, 7 Mar 2026 12:29:10 -0500 Subject: [PATCH] Simplify git add pathspec building by hoisting common arg Co-Authored-By: Claude Opus 4.6 --- crates/arc-workflows/src/git.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/crates/arc-workflows/src/git.rs b/crates/arc-workflows/src/git.rs index 6c63960b2..cf85bb756 100644 --- a/crates/arc-workflows/src/git.rs +++ b/crates/arc-workflows/src/git.rs @@ -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()