1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-26 18:46:11 +02:00

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>
This commit is contained in:
Fredrik Kuivinen 2007-02-22 21:28:12 +01:00 committed by Junio C Hamano
parent 4917d2a66e
commit 755b99d815

View File

@ -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 &&