diff --git a/pre-commit/check-secrets-encrypted-with-ansible-vault.py b/pre-commit/check-secrets-encrypted-with-ansible-vault.py index 6e7d0b9..7f0a2ab 100755 --- a/pre-commit/check-secrets-encrypted-with-ansible-vault.py +++ b/pre-commit/check-secrets-encrypted-with-ansible-vault.py @@ -15,10 +15,10 @@ ANSIBLE_VAULT_MARKER = "$ANSIBLE_VAULT" def get_staged_files(): - """Get list of staged files for commit.""" + """Get list of staged files for commit, excluding deleted files.""" try: result = subprocess.run( - ["git", "diff", "--cached", "--name-only"], + ["git", "diff", "--cached", "--name-only", "--diff-filter=AM"], capture_output=True, text=True, check=True,