Skip to content

Commit

Permalink
Reset git index after pre-commit automation
Browse files Browse the repository at this point in the history
  • Loading branch information
lkubb committed Sep 25, 2024
1 parent d674138 commit a24b58d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog/+renovate.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Made repo automation reset git index after running pre-commit to allow RenovateBot to detect new files correctly
3 changes: 3 additions & 0 deletions project/tools/helpers/pre_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,7 @@ def _run_pre_commit_loop(retries_left):
prompt.warn(f"Pre-commit is failing. {msg}")
for i, failing_hook in enumerate(failing):
prompt.warn(f"✗ Failing hook ({i + 1}): {failing_hook}", failing[failing_hook])
finally:
# Undo git add --intent-to-add to allow RenovateBot to detect new files correctly
git("restore", "--staged", ".")
return False

0 comments on commit a24b58d

Please sign in to comment.