zap-zsh / zap-prompt

⚡➜ ~

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"this operation must be run in a work tree" when working directory is a bare repo

skkeeper opened this issue · comments

Replication steps:

  • create a new directory with a bare git repo ("git init --bare")
  • cd into it

The prompt will show
fatal: this operation must be run in a work tree

I think the git status --porcelain is the culprit but I haven't managed to redirect the stderr properly or test if that's even a correct fix.

This is pretty annoying for people that work with bare repositories as a root for "git worktree" commands.

This also affects forks like "MAHcodes/distro-prompt"