summaryrefslogtreecommitdiff
path: root/git-clean.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2007-11-14 03:37:18 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2007-11-14 03:37:18 -0800
commitfb5fd011482b5aa0b340a4a5bd9192c0efc1edb7 (patch)
tree1701d97cd2ae3aa4ce52127cf8343b8b1efc9383 /git-clean.sh
parentFix dependencies of parse-options test program (diff)
parentgit-clean: honor core.excludesfile (diff)
downloadtgif-fb5fd011482b5aa0b340a4a5bd9192c0efc1edb7.tar.xz
Merge branch 'maint'
* maint: git-clean: honor core.excludesfile Documentation: Fix man page breakage with DocBook XSL v1.72 git-remote.txt: fix typo core-tutorial.txt: Fix argument mistake in an example. replace reference to git-rm with git-reset in git-commit doc Grammar fixes for gitattributes documentation Don't allow fast-import tree delta chains to exceed maximum depth revert/cherry-pick: allow starting from dirty work tree. t/t3404: fix test for a bogus todo file. Conflicts: fast-import.c
Diffstat (limited to 'git-clean.sh')
-rwxr-xr-xgit-clean.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/git-clean.sh b/git-clean.sh
index 521fabc20f..ad68595fbf 100755
--- a/git-clean.sh
+++ b/git-clean.sh
@@ -83,15 +83,22 @@ esac
if [ -z "$ignored" ]; then
excl="--exclude-per-directory=.gitignore"
+ excl_info= excludes_file=
if [ -f "$GIT_DIR/info/exclude" ]; then
excl_info="--exclude-from=$GIT_DIR/info/exclude"
fi
+ if cfg_excl=$(git config core.excludesfile) && test -f "$cfg_excl"
+ then
+ excludes_file="--exclude-from=$cfg_excl"
+ fi
if [ "$ignoredonly" ]; then
excl="$excl --ignored"
fi
fi
-git ls-files --others --directory $excl ${excl_info:+"$excl_info"} -- "$@" |
+git ls-files --others --directory \
+ $excl ${excl_info:+"$excl_info"} ${excludes_file:+"$excludes_file"} \
+ -- "$@" |
while read -r file; do
if [ -d "$file" -a ! -L "$file" ]; then
if [ -z "$cleandir" ]; then