Fix precommit (#211)

* stash unstaged changes

* enhance: pre-commit, only run on staged changes
buddies-main-deployment
Erin Hales 4 years ago committed by GitHub
parent 5975ff97bc
commit 669419babb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      pre-commit.sh

@ -1,5 +1,9 @@
#!/bin/sh
# Stash uncommitted changes
STASH_NAME="pre-commit-$(date +%s)"
git stash save -q --keep-index $STASH_NAME
abort()
{
echo >&2 '
@ -54,3 +58,5 @@ echo >&2 '
*** DONE ***
************
'
git stash apply stash^{/$STASH_NAME}

Loading…
Cancel
Save