avoid echo -e, there are systems where it does not work
[git/spearce.git] / git-add.sh
blobf719b4b1a81a386c9cf62efad811005471be0f8c
1 #!/bin/sh
3 USAGE='[-n] [-v] <file>...'
4 SUBDIRECTORY_OK='Yes'
5 . git-sh-setup
7 show_only=
8 verbose=
9 while : ; do
10 case "$1" in
11 -n)
12 show_only=true
14 -v)
15 verbose=--verbose
17 -*)
18 usage
21 break
23 esac
24 shift
25 done
27 if test -f "$GIT_DIR/info/exclude"
28 then
29 git-ls-files -z \
30 --exclude-from="$GIT_DIR/info/exclude" \
31 --others --exclude-per-directory=.gitignore -- "$@"
32 else
33 git-ls-files -z \
34 --others --exclude-per-directory=.gitignore -- "$@"
35 fi |
36 case "$show_only" in
37 true)
38 xargs -0 echo ;;
40 git-update-index --add $verbose -z --stdin ;;
41 esac