14 test -f $ZIT_FILE || abort "No such file $ZIT_FILE"
15 test $ZIT_FILE = "`basename $ZIT_FILE`" || abort "Sorry, Zit only works on files in the current directory"
16 ZIT_DIR=".zit.$ZIT_FILE"
21 test -e $ZIT_DIR && abort "$ZIT_DIR exists, is $ZIT_FILE tracked already?"
22 mkdir $ZIT_DIR && echo "Initializing Zit repository in $ZIT_DIR"
23 test -d $ZIT_DIR || abort "Failed to create $ZIT_DIR"
25 git init || abort "Failed to initialize Git repository in $ZIT_DIR"
26 ln ../$ZIT_FILE $ZIT_FILE || abort "Failed to link $ZIT_FILE into $ZIT_DIR"
27 git add $ZIT_FILE || abort "Failed to add $ZIT_FILE"
28 git commit "$@" || abort "Failed to make first commit for $ZIT_FILE"
32 for file in `find -path ./.zit.\*/.git`; do
33 export GIT_DIR="$file"
34 file="${file#./.zit.}"
36 # TODO show actual file status