blob: f719b4b1a81a386c9cf62efad811005471be0f8c [file] [log] [blame]
Junio C Hamano215a7ad2005-09-07 17:26:23 -07001#!/bin/sh
Linus Torvalds37539fb2005-09-18 11:27:45 -07002
freku045@student.liu.se806f36d2005-12-13 23:30:31 +01003USAGE='[-n] [-v] <file>...'
4SUBDIRECTORY_OK='Yes'
5. git-sh-setup
Chris Shoemaker918db542005-10-29 17:46:41 -04006
Linus Torvalds37539fb2005-09-18 11:27:45 -07007show_only=
8verbose=
9while : ; do
10 case "$1" in
11 -n)
12 show_only=true
Linus Torvalds37539fb2005-09-18 11:27:45 -070013 ;;
14 -v)
Junio C Hamanocaf4f582005-10-14 21:56:46 -070015 verbose=--verbose
Linus Torvalds37539fb2005-09-18 11:27:45 -070016 ;;
Chris Shoemaker918db542005-10-29 17:46:41 -040017 -*)
18 usage
19 ;;
Linus Torvalds37539fb2005-09-18 11:27:45 -070020 *)
21 break
22 ;;
23 esac
24 shift
25done
26
Junio C Hamanocaf4f582005-10-14 21:56:46 -070027if test -f "$GIT_DIR/info/exclude"
28then
29 git-ls-files -z \
30 --exclude-from="$GIT_DIR/info/exclude" \
Junio C Hamano4bfe1192005-10-18 00:27:50 -070031 --others --exclude-per-directory=.gitignore -- "$@"
Junio C Hamanocaf4f582005-10-14 21:56:46 -070032else
33 git-ls-files -z \
Junio C Hamano4bfe1192005-10-18 00:27:50 -070034 --others --exclude-per-directory=.gitignore -- "$@"
Junio C Hamanocaf4f582005-10-14 21:56:46 -070035fi |
36case "$show_only" in
37true)
38 xargs -0 echo ;;
39*)
40 git-update-index --add $verbose -z --stdin ;;
41esac