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 /git-commit.sh | |
parent | 4917d2a66e8fa8c40ea6082c0fd8b58492c9444e (diff) | |
download | git-755b99d81539461645088085ea033a3b36152da5.tar.gz |
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>
Diffstat (limited to 'git-commit.sh')
-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 && |