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>
Fredrik Kuivinen committed
Feb 22, 2007 at 21:28 UTC
755b99d81539461645088085ea033a3b36152da5
1 file changed
+4
git-commit.sh
+4
@@ -318,6 +318,10 @@ esac
318
319
case "$all,$also" in
320
t,)
321
+ if test ! -f "$THIS_INDEX"
322
+ then
323
+ die 'nothing to commit (use "git add file1 file2" to include for commit)'
324
+ fi
325
save_index &&
326
(
327
cd_to_toplevel &&