| # Copyright (c) 2005-2006 Pavel Roskin |
| USAGE="[-d] [-n] [-q] [-x | -X]" |
| LONG_USAGE='Clean untracked files from the working directory |
| -d remove directories as well |
| -n don'\''t remove anything, just show what would be done |
| -q be quiet, only report errors |
| -x remove ignored files as well |
| -X remove only ignored files as well' |
| rm_refuse="echo Not removing" |
| while case "$#" in 0) break ;; esac |
| rm_refuse="echo Would not remove" |
| case "$ignored,$ignoredonly" in |
| if [ -z "$ignored" ]; then |
| excl="--exclude-per-directory=.gitignore" |
| if [ -f "$GIT_DIR/info/exclude" ]; then |
| excl_info="--exclude-from=$GIT_DIR/info/exclude" |
| if [ "$ignoredonly" ]; then |
| git-ls-files --others --directory $excl ${excl_info:+"$excl_info"} | |
| if [ -d "$file" -a ! -L "$file" ]; then |
| if [ -z "$cleandir" ]; then |