File: guilt-diff

package info (click to toggle)
guilt 0.35-1.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,492 kB
  • sloc: sh: 2,557; makefile: 119; perl: 42
file content (33 lines) | stat: -rwxr-xr-x 438 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
#
# Copyright (C) Josef 'Jeff' Sipek, 2007-2011
#

USAGE="[-z] [<path>...]"
if [ -z "$GUILT_VERSION" ]; then
	echo "Invoking `basename $0` directly is no longer supported." >&2
	exit 1
fi

_main() {

while [ $# -ne 0 ]; do
	case "$1" in
	-z)
		working_tree=t ;;
	-* | --*)
		usage ;;

	*)
		break ;;
	esac
	shift
done

PREV=HEAD^
[ -z "`get_top`" ] && PREV=
[ ! -z "$working_tree" ] && PREV=

git diff --binary $PREV -- "$@"

}