[PATCH] Fix git-rev-parse --default and --flags handling
[git/jnareb-git.git] / git-diff-script
blob99ff2640f127e36fd4351557e27e7b8a683a07ce
1 #!/bin/sh
2 rev=($(git-rev-parse --revs-only "$@")) || exit
3 flags=($(git-rev-parse --no-revs --flags "$@"))
4 files=($(git-rev-parse --no-revs --no-flags "$@"))
5 case "${#rev[*]}" in
6 0)
7 git-diff-files -M -p "$@";;
8 1)
9 git-diff-cache -M -p "$@";;
11 case "${rev[1]}" in
12 ^?*)
13 begin=$(echo "${rev[1]}" | tr -d '^')
14 end="${rev[0]}" ;;
16 begin="${rev[0]}"
17 end="${rev[1]}" ;;
18 esac
19 git-diff-tree -M -p $flags $begin $end $files;;
21 echo "I don't understand"
22 exit 1;;
23 esac