threads / bug / 57677

BUG: cannot remove new staged files in sparse checkout

Subject: BUG: cannot remove new staged files in sparse checkout

## tl;dr

2 messages between Apr 6, 2022 and Apr 6, 2022.

replies: 1people: 1as markdown or json

Erik Cervin Edin· Apr 6, 2022, 12:51 UTC · lore
Hi friends!
I've stumbled across what I believe is a bug
I've found myself with new files that are staged, not part of the
sparse-checkout, that I cannot unstage using git restore --staged, ie
  git restore --staged :\
does nothing.
I'm able to get rid of the using
  git stash && git stash drop
but intuitively I would expect restore --staged to work, even if the
files are not part of the sparse checkout
I end up in this peculiar situation by doing the following.
Having branches:
  foo/bar
  origin/foo
and then running
  git switch -c foo
Updatings files: 100% (X/X) done.
fatal: cannot lock ref 'refs/heads/foo': 'refs/heads/foo/bar' exists;
cannot create 'refs/heads/foo'

← back to recent threads