zap-prompt icon indicating copy to clipboard operation
zap-prompt copied to clipboard

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

Open skkeeper opened this issue 1 year ago • 0 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"

skkeeper avatar May 04 '23 13:05 skkeeper