X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-commit-script;h=04d16ae92f6a5d1e36eac9901806faa20f309984;hb=62b532b080d56e02d8f486e801110456ab0bb380;hp=2632afdeede1af08e59fe1163cc8be2ba9e9f5cf;hpb=85c1f337be49eaa9a22e42a1c9958deef5ab57c3;p=git.git diff --git a/git-commit-script b/git-commit-script index 2632afde..04d16ae9 100755 --- a/git-commit-script +++ b/git-commit-script @@ -3,16 +3,13 @@ # Copyright (c) 2005 Linus Torvalds # +. git-sh-setup-script || die "Not a git archive" + usage () { - echo 'git commit [-m existing-commit] [...]' - exit 1 + die 'git commit [-m existing-commit] [...]' } -: ${GIT_DIR=.git} -if [ ! -d "$GIT_DIR" ]; then - echo Not a git directory 1>&2 - exit 1 -fi +files=() while case "$#" in 0) break ;; esac do case "$1" in @@ -23,13 +20,16 @@ do exit ;; esac ;; + --all) + files=($(git-diff-files --name-only))\ + ;; *) break ;; esac shift done -git-update-cache -q --refresh -- "$@" || exit 1 +git-update-cache -q --refresh -- "$@" "${files[@]}" || exit 1 PARENTS="-p HEAD" if [ ! -r "$GIT_DIR/HEAD" ]; then if [ -z "$(git-ls-files)" ]; then