Update git-diff-* to use C-style quoting for funny pathnames.
[git.git] / git-add.sh
bloba8498c729ab3188bd21dd6a54ddc77d4c34ac48a
1 #!/bin/sh
3 show_only=
4 verbose=
5 while : ; do
6 case "$1" in
7 -n)
8 show_only=true
9 ;;
10 -v)
11 verbose=--verbose
14 break
16 esac
17 shift
18 done
20 GIT_DIR=$(git-rev-parse --git-dir) || exit
22 if test -f "$GIT_DIR/info/exclude"
23 then
24 git-ls-files -z \
25 --exclude-from="$GIT_DIR/info/exclude" \
26 --others --exclude-per-directory=.gitignore "$@"
27 else
28 git-ls-files -z \
29 --others --exclude-per-directory=.gitignore "$@"
30 fi |
31 case "$show_only" in
32 true)
33 xargs -0 echo ;;
35 git-update-index --add $verbose -z --stdin ;;
36 esac