From b133a0d120ce9de3ab3165ee0336a88a5023a3d9 Mon Sep 17 00:00:00 2001 From: nholtware Date: Thu, 5 Nov 2026 12:10:26 -0600 Subject: [PATCH] fix(delete-service): don't git-add paths already removed by git rm Co-Authored-By: Claude Opus 5.5 --- lib/common.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/common.sh b/lib/common.sh index e510362..8be3057 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -158,7 +158,10 @@ gitops_commit_push() { dry "git -C $GITOPS_DIR add -A $* && git commit -m '$msg' && git push origin main" return 0 fi - git -C "$GITOPS_DIR" add -A -- "$@" + local p + for p in "$@"; do # paths removed with `git rm` are already staged; add errors on them + if [[ -e $GITOPS_DIR/$p ]]; then git -C "$GITOPS_DIR" add -A -- "$p"; fi + done if git -C "$GITOPS_DIR" diff --cached --quiet; then ok "gitops: nothing to commit for: $msg" return 0