geometry-zsh/geometry

git init produces an error: fatal: ambiguous argument 'HEAD'

russmack opened this issue · 2 comments

Describe the bug
git init produces:
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Other (all?) git command produce the same.

To Reproduce
Steps to reproduce the behavior:

  1. Type git init
  2. See error

Expected behavior
No error.

Desktop (please complete the following information):

  • OS: Arch Linux
  • Git Version 2.30.0
  • Geometry version: latest a8033e0
lox commented

This happens whenever there isn't a commit in the repo, the relevant line is https://github.com/geometry-zsh/geometry/blob/main/functions/geometry_git#L31.

I think it should be git diff --quiet vs git diff-index --quiet HEAD.

Resolved by #304