Created
June 6, 2012 21:36
-
-
Save rdarder/2884976 to your computer and use it in GitHub Desktop.
export changed files on git index to a temp folder, useful for a pre-hook that does linting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tmpdir=`mktemp -d` | |
tree=`git write-tree` | |
git archive $tree \ | |
$(git diff --cached --name-status | | |
grep -v "^D" | | |
awk '{print $2}' | |
) | | |
tar xv -C $tmpdir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment