Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Fix git-status when HEAD is invalid.
author
Junio C Hamano
<junkio@cox.net>
Thu, 1 Sep 2005 00:13:48 +0000
(17:13 -0700)
committer
Junio C Hamano
<junkio@cox.net>
Thu, 1 Sep 2005 00:13:48 +0000
(17:13 -0700)
It tried to do git-diff-cache against HEAD, of course.
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-status-script
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
6e7722e
)
diff --git
a/git-status-script
b/git-status-script
index 1696f23e04a1b96234c60ae07306fdd94d0da314..2b029545de3366d4d51b9060bc31cc6dc97260a5 100755
(executable)
--- a/
git-status-script
+++ b/
git-status-script
@@
-39,11
+39,23
@@
esac
git-update-cache --refresh >/dev/null 2>&1
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/^://' |
git-diff-files |
sed 's/^://' |