diff options
author | Fredrik Kuivinen <frekui@gmail.com> | 2007-02-22 21:28:12 +0100 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-02-22 21:02:39 -0800 |
commit | 755b99d81539461645088085ea033a3b36152da5 (patch) | |
tree | dd8f3df5ee88197ea19898daddfa73f7d0fd1297 | |
parent | Include git-gui credits file in dist. (diff) | |
download | tgif-755b99d81539461645088085ea033a3b36152da5.tar.xz |
Fix 'git commit -a' in a newly initialized repository
With current git:
$ git init
$ git commit -a
cp: cannot stat `.git/index': No such file or directory
Output a nice error message instead.
Signed-off-by: Fredrik Kuivinen <frekui@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
-rwxr-xr-x | git-commit.sh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/git-commit.sh b/git-commit.sh index ec506d956f..476f4f18db 100755 --- a/git-commit.sh +++ b/git-commit.sh @@ -318,6 +318,10 @@ esac case "$all,$also" in t,) + if test ! -f "$THIS_INDEX" + then + die 'nothing to commit (use "git add file1 file2" to include for commit)' + fi save_index && ( cd_to_toplevel && |