summaryrefslogtreecommitdiff
path: root/git-commit.sh
diff options
context:
space:
mode:
authorFredrik Kuivinen <frekui@gmail.com>2007-02-22 20:28:12 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-02-23 05:02:39 (GMT)
commit755b99d81539461645088085ea033a3b36152da5 (patch)
treedd8f3df5ee88197ea19898daddfa73f7d0fd1297 /git-commit.sh
parent4917d2a66e8fa8c40ea6082c0fd8b58492c9444e (diff)
downloadgit-755b99d81539461645088085ea033a3b36152da5.zip
git-755b99d81539461645088085ea033a3b36152da5.tar.gz
git-755b99d81539461645088085ea033a3b36152da5.tar.bz2
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-xgit-commit.sh4
1 files changed, 4 insertions, 0 deletions
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 &&