ref-log: allow ref@{count} syntax.
[gitweb.git] / git-commit.sh
index 10c269a8de8b5543120099a9b0f71f99aca89de7..ee5a165e74a4d3a0d204ebe10650688050547b90 100755 (executable)
@@ -82,7 +82,8 @@ run_status () {
   esac
   git-runstatus ${color} \
                 ${verbose:+--verbose} \
-                ${amend:+--amend}
+                ${amend:+--amend} \
+               ${untracked_files:+--untracked}
 }
 
 trap '
@@ -546,15 +547,15 @@ then
                PARENTS=$(git-cat-file commit HEAD |
                        sed -n -e '/^$/q' -e 's/^parent /-p /p')
        fi
-       current=$(git-rev-parse --verify HEAD)
+       current="$(git-rev-parse --verify HEAD)"
 else
        if [ -z "$(git-ls-files)" ]; then
                echo >&2 Nothing to commit
                exit 1
        fi
        PARENTS=""
-       current=
        rloga='commit (initial)'
+       current=''
 fi
 
 if test -z "$no_edit"
@@ -630,7 +631,7 @@ then
        fi &&
        commit=$(cat "$GIT_DIR"/COMMIT_MSG | git-commit-tree $tree $PARENTS) &&
        rlogm=$(sed -e 1q "$GIT_DIR"/COMMIT_MSG) &&
-       git-update-ref -m "$rloga: $rlogm" HEAD $commit $current &&
+       git-update-ref -m "$rloga: $rlogm" HEAD $commit "$current" &&
        rm -f -- "$GIT_DIR/MERGE_HEAD" &&
        if test -f "$NEXT_INDEX"
        then