Code

gitweb: Lift any characters restriction on searched strings
[git.git] / git-commit.sh
index 4290ae2dd2747b26c521300af1ed5e46ab839264..1d04f1ff31cf99a6dec1d52866668007ab2dae72 100755 (executable)
@@ -49,10 +49,11 @@ run_status () {
                export GIT_INDEX_FILE
        fi
 
-       case "$status_only" in
-       t) color= ;;
-       *) color=--nocolor ;;
-       esac
+       if test "$status_only" = "t" -o "$use_status_color" = "t"; then
+               color=
+       else
+               color=--nocolor
+       fi
        git runstatus ${color} \
                ${verbose:+--verbose} \
                ${amend:+--amend} \
@@ -190,7 +191,6 @@ $1"
                ;;
        --a|--am|--ame|--amen|--amend)
                amend=t
-               log_given=t$log_given
                use_commit=HEAD
                shift
                ;;
@@ -298,9 +298,9 @@ esac
 
 case "$log_given" in
 tt*)
-       die "Only one of -c/-C/-F/--amend can be used." ;;
+       die "Only one of -c/-C/-F can be used." ;;
 *tm*|*mt*)
-       die "Option -m cannot be combined with -c/-C/-F/--amend." ;;
+       die "Option -m cannot be combined with -c/-C/-F." ;;
 esac
 
 case "$#,$also,$only,$amend" in
@@ -557,6 +557,7 @@ fi
 if [ "$?" != "0" -a ! -f "$GIT_DIR/MERGE_HEAD" -a -z "$amend" ]
 then
        rm -f "$GIT_DIR/COMMIT_EDITMSG" "$GIT_DIR/SQUASH_MSG"
+       use_status_color=t
        run_status
        exit 1
 fi