fix: fixed pre and post commit hook behavior

This commit is contained in:
Leyla Becker 2025-10-20 20:55:35 -05:00
parent 290c0692bb
commit f21777b1fb
4 changed files with 48 additions and 16 deletions

View file

@ -3,4 +3,12 @@
echo "restoring stashed changes"
git stash pop -q
# Find the most recent pre-commit stash and restore it
recent_stash=$(git stash list | grep "pre-commit-stash-" | head -n 1 | cut -d: -f1)
if [ -n "$recent_stash" ]; then
echo "Found recent pre-commit stash: $recent_stash"
git stash pop -q "$recent_stash"
else
echo "No pre-commit stash found to restore"
fi