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>
---
git-commit.sh | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
Show changes to git-commit.sh +4 −0
diff --git a/git-commit.sh b/git-commit.sh index ec506d9..476f4f1 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 &&