1#!/bin/sh23USAGE='[-n] [-v] <file>...'4SUBDIRECTORY_OK='Yes'5. git-sh-setup67show_only=8verbose=9while : ; do10case "$1" in11-n)12show_only=true13;;14-v)15verbose=--verbose16;;17-*)18usage19;;20*)21break22;;23esac24shift25done2627# Check misspelled pathspec28case "$#" in290) ;;30*)31git-ls-files --error-unmatch --others --cached -- "$@" >/dev/null || {32echo >&2 "Maybe you misspelled it?"33exit 134}35;;36esac3738if test -f "$GIT_DIR/info/exclude"39then40git-ls-files -z \41--exclude-from="$GIT_DIR/info/exclude" \42--others --exclude-per-directory=.gitignore -- "$@"43else44git-ls-files -z \45--others --exclude-per-directory=.gitignore -- "$@"46fi |47case "$show_only" in48true)49xargs -0 echo ;;50*)51git-update-index --add $verbose -z --stdin ;;52esac