Skip to content

Commit 5a43c17

Browse files
authored
Silence a git warning in a repo without a HEAD (#304)
1 parent 74444e6 commit 5a43c17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

functions/geometry_git

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ geometry_git_branch() {
2828
geometry_git_status() {
2929
command git rev-parse --git-dir > /dev/null 2>&1 || return
3030

31-
git diff-index --quiet HEAD \
31+
git diff-index --quiet HEAD 2> /dev/null \
3232
&& [[ -z "$(git status --porcelain --ignore-submodules)" ]] \
3333
&& ansi ${GEOMETRY_GIT_COLOR_CLEAN:-green} ${GEOMETRY_GIT_SYMBOL_CLEAN:-"⬢"} \
3434
|| ansi ${GEOMETRY_GIT_COLOR_DIRTY:-red} ${GEOMETRY_GIT_SYMBOL_DIRTY:-"⬡"}

0 commit comments

Comments
 (0)