Make "git commit" handle initial commits too
[git/jnareb-git.git] / git-diff-script
blobd70e8b9f2961fb5cbe53d473af8f2c1c8c1024d4
1 #!/bin/sh
2 rev=($(git-rev-parse --revs-only "$@"))
3 flags=($(git-rev-parse --no-revs "$@"))
4 case "${#rev[*]}" in
5 0)
6 git-diff-files -p "$@";;
7 1)
8 git-diff-cache -p "$@";;
9 2)
10 begin=$(echo "${rev[1]}" | tr -d '^')
11 end="${rev[0]}"
12 git-diff-tree -p $flags $begin $end;;
14 echo "I don't understand"
15 exit 1;;
16 esac