fix(delete-service): don't git-add paths already removed by git rm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
253b6033c3
commit
b133a0d120
1 changed files with 4 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue