summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-09-01 00:13:48 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-09-01 00:13:48 (GMT)
commit7e011c40bc6c7dbd48b033fb16c861b1166f808c (patch)
tree58a26ae0dfe322d540d001f116294c16cc7d3b1b
parent6e7722e6f88c049f43a1c00c45c502542d1a5752 (diff)
downloadgit-7e011c40bc6c7dbd48b033fb16c861b1166f808c.zip
git-7e011c40bc6c7dbd48b033fb16c861b1166f808c.tar.gz
git-7e011c40bc6c7dbd48b033fb16c861b1166f808c.tar.bz2
Fix git-status when HEAD is invalid.
It tried to do git-diff-cache against HEAD, of course. Signed-off-by: Junio C Hamano <junkio@cox.net>
-rwxr-xr-xgit-status-script20
1 files changed, 16 insertions, 4 deletions
diff --git a/git-status-script b/git-status-script
index 1696f23..2b02954 100755
--- a/git-status-script
+++ b/git-status-script
@@ -39,11 +39,23 @@ esac
git-update-cache --refresh >/dev/null 2>&1
-git-diff-cache -M --cached HEAD |
-sed 's/^://' |
-report "Updated but not checked in" "will commit"
+if test -f "$GIT_DIR/HEAD"
+then
+ git-diff-cache -M --cached HEAD |
+ sed 's/^://' |
+ report "Updated but not checked in" "will commit"
-committable="$?"
+ committable="$?"
+else
+ echo '#
+# Initial commit
+#'
+ git-ls-files |
+ sed 's/^/o o o o A /' |
+ report "Updated but not checked in" "will commit"
+
+ committable="$?"
+fi
git-diff-files |
sed 's/^://' |