Skip to content

Commit

Permalink
git-null: Handle filenames starting with '-' properly
Browse files Browse the repository at this point in the history
  • Loading branch information
rosslagerwall committed Mar 19, 2013
1 parent 7a9882d commit 2dc4b7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-null
Expand Up @@ -19,7 +19,7 @@ if [ -n "$OUTPUT" ]; then
fi fi


echo "Updating `pwd` to the *null* revision." echo "Updating `pwd` to the *null* revision."
git ls-files -z | xargs -0 rm # delete all tracked files git ls-files -z | xargs -0 rm -- # delete all tracked files
# Delete all empty directories except for ./.git # Delete all empty directories except for ./.git
find . -type d -not \( -path './.git/*' -or -path './.git' \) -delete find . -type d -not \( -path './.git/*' -or -path './.git' \) -delete
echo "To go back to the previous state, run: git reset --hard" echo "To go back to the previous state, run: git reset --hard"

0 comments on commit 2dc4b7e

Please sign in to comment.