Skip deleted files while check files with secrets

This commit is contained in:
2025-08-07 15:07:29 +03:00
parent 6caeb998c4
commit b0bccb759b

View File

@@ -15,10 +15,10 @@ ANSIBLE_VAULT_MARKER = "$ANSIBLE_VAULT"
def get_staged_files(): def get_staged_files():
"""Get list of staged files for commit.""" """Get list of staged files for commit, excluding deleted files."""
try: try:
result = subprocess.run( result = subprocess.run(
["git", "diff", "--cached", "--name-only"], ["git", "diff", "--cached", "--name-only", "--diff-filter=AM"],
capture_output=True, capture_output=True,
text=True, text=True,
check=True, check=True,