]>
Commit | Line | Data |
---|---|---|
215a7ad1 | 1 | #!/bin/sh |
37539fbd | 2 | |
806f36d4 FK |
3 | USAGE='[-n] [-v] <file>...' |
4 | SUBDIRECTORY_OK='Yes' | |
5 | . git-sh-setup | |
918db541 | 6 | |
37539fbd LT |
7 | show_only= |
8 | verbose= | |
9 | while : ; do | |
10 | case "$1" in | |
11 | -n) | |
12 | show_only=true | |
37539fbd LT |
13 | ;; |
14 | -v) | |
caf4f582 | 15 | verbose=--verbose |
37539fbd | 16 | ;; |
918db541 CS |
17 | -*) |
18 | usage | |
19 | ;; | |
37539fbd LT |
20 | *) |
21 | break | |
22 | ;; | |
23 | esac | |
24 | shift | |
25 | done | |
26 | ||
caf4f582 JH |
27 | if test -f "$GIT_DIR/info/exclude" |
28 | then | |
29 | git-ls-files -z \ | |
30 | --exclude-from="$GIT_DIR/info/exclude" \ | |
4bfe1199 | 31 | --others --exclude-per-directory=.gitignore -- "$@" |
caf4f582 JH |
32 | else |
33 | git-ls-files -z \ | |
4bfe1199 | 34 | --others --exclude-per-directory=.gitignore -- "$@" |
caf4f582 JH |
35 | fi | |
36 | case "$show_only" in | |
37 | true) | |
38 | xargs -0 echo ;; | |
39 | *) | |
40 | git-update-index --add $verbose -z --stdin ;; | |
41 | esac |