zap-prompt
zap-prompt copied to clipboard
"this operation must be run in a work tree" when working directory is a bare repo
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"