Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
skkeeper opened this issue May 4, 2023 · 0 comments

Comments

@skkeeper
Copy link

skkeeper commented May 4, 2023

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant