exit 1
}
-THIS_INDEX="$GIT_DIR/index"
+TMP_INDEX=
+THIS_INDEX="${GIT_INDEX_FILE:-$GIT_DIR/index}"
NEXT_INDEX="$GIT_DIR/next-index$$"
rm -f "$NEXT_INDEX"
save_index () {
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} \
only_include_assumed=
untracked_files=
templatefile="`git config commit.template`"
-while case "$#" in 0) break;; esac
+while test $# != 0
do
case "$1" in
-F|--F|-f|--f|--fi|--fil|--file)
case "$all,$interactive,$also,$#" in
*t,*t,*)
die "Cannot use -a, --interactive or -i at the same time." ;;
-t,,[1-9]*)
+t,,,[1-9]*)
die "Paths with -a does not make sense." ;;
-,t,[1-9]*)
+,t,,[1-9]*)
die "Paths with --interactive does not make sense." ;;
,,t,0)
die "No paths with -i does not make sense." ;;
then
refuse_partial "Cannot do a partial commit during a merge."
fi
+
TMP_INDEX="$GIT_DIR/tmp-index$$"
- commit_only=`git ls-files --error-unmatch -- "$@"` || exit
+ W=
+ test -z "$initial_commit" && W=--with-tree=HEAD
+ commit_only=`git ls-files --error-unmatch $W -- "$@"` || exit
# Build a temporary index and update the real index
# the same way.
(
GIT_INDEX_FILE="$NEXT_INDEX"
export GIT_INDEX_FILE
- git update-index --remove --stdin
+ git update-index --add --remove --stdin
) || exit
;;
esac
# we need to check if there is anything to commit
run_status >/dev/null
fi
-if [ "$?" != "0" -a ! -f "$GIT_DIR/MERGE_HEAD" -a -z "$amend" ]
+if [ "$?" != "0" -a ! -f "$GIT_DIR/MERGE_HEAD" ]
then
rm -f "$GIT_DIR/COMMIT_EDITMSG" "$GIT_DIR/SQUASH_MSG"
+ use_status_color=t
run_status
exit 1
fi