[PATCH] guilt-refresh: Check color.ui git config before refresh
[guilt.git] / guilt-refresh
blobd4dac2ebce029602b332d4f6a380a32dcb1036ee
1 #!/bin/sh
3 # Copyright (c) Josef "Jeff" Sipek, 2006-2013
6 USAGE="[--git] [--diffstat]"
7 COLOR=`git config --get color.ui`
9 if [ -z "$GUILT_VERSION" ]; then
10 echo "Invoking `basename "$0"` directly is no longer supported." >&2
11 exit 1
14 _main() {
16 if [ "$COLOR" = "always" ]; then
17 echo "git color.ui=always is unsupported because"
18 echo "escape characters will be redirected"
19 echo "please set it to color.ui=auto"
20 exit 1
23 while [ $# -gt 0 ]; do
24 case "$1" in
25 --git)
26 gdiff=t ;;
27 --diffstat)
28 dstat=t ;;
30 usage ;;
31 esac
32 shift
33 done
35 TOP=`get_top`
37 if [ -z "$TOP" ]; then
38 die "No patches applied; try guilt push first"
41 refresh_patch "$TOP" "$gdiff" "$dstat"
42 echo "Patch $TOP refreshed"