diff --git a/git-commit.sh b/git-commit.sh
index ab5e6bc1c8e594bdaba9d1950c18efa7c45d8852..f7ee1aadee1eb947603dadbd6ec077dab07f6a19 100755 (executable)
--- a/git-commit.sh
+++ b/git-commit.sh
verbose=
signoff=
force_author=
verbose=
signoff=
force_author=
+only_include_assumed=
while case "$#" in 0) break;; esac
do
case "$1" in
while case "$#" in 0) break;; esac
do
case "$1" in
0,)
;;
*,)
0,)
;;
*,)
- echo >&2 "assuming --only paths..."
+ only_include_assumed="# Explicit paths specified without -i nor -o; assuming --only paths..."
also=
also=
-
- # If we are going to launch an editor, the message won't be
- # shown without this...
- test -z "$log_given$status_only" && sleep 1
;;
esac
unset only
;;
esac
unset only
;;
,t)
save_index &&
;;
,t)
save_index &&
+ git-ls-files --error-unmatch -- "$@" >/dev/null || exit
+
git-diff-files --name-only -z -- "$@" |
(
cd "$TOP"
git-diff-files --name-only -z -- "$@" |
(
cd "$TOP"
refuse_partial "Different in index and the last commit:
$dirty_in_index"
fi
refuse_partial "Different in index and the last commit:
$dirty_in_index"
fi
- commit_only=`git-ls-files -- "$@"`
+ commit_only=`git-ls-files --error-unmatch -- "$@"` || exit
# Build the temporary index and update the real index
# the same way.
# Build the temporary index and update the real index
# the same way.
PARENTS=""
fi
PARENTS=""
fi
-run_status >>"$GIT_DIR"/COMMIT_EDITMSG
+{
+ test -z "$only_include_assumed" || echo "$only_include_assumed"
+ run_status
+} >>"$GIT_DIR"/COMMIT_EDITMSG
if [ "$?" != "0" -a ! -f "$GIT_DIR/MERGE_HEAD" ]
then
rm -f "$GIT_DIR/COMMIT_EDITMSG"
if [ "$?" != "0" -a ! -f "$GIT_DIR/MERGE_HEAD" ]
then
rm -f "$GIT_DIR/COMMIT_EDITMSG"