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>
This commit is contained in:
@ -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 |
|
if test -f "$GIT_DIR/HEAD"
|
||||||
sed 's/^://' |
|
then
|
||||||
report "Updated but not checked in" "will commit"
|
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 |
|
git-diff-files |
|
||||||
sed 's/^://' |
|
sed 's/^://' |
|
||||||
|
Reference in New Issue
Block a user