# Possible bug: Changing branch with file locked

1 messages from 2020-07-09 to 2020-07-09. Participants: Antti Tanskanen.
Thread: https://gitlist.dev/t/53822

## Antti Tanskanen, 2020-07-09 11:01

Subject: Possible bug: Changing branch with file locked
Message-ID: <CADGzKpxJ7_5htGVgHfvU-caPTm2tLxmCvuc-RoYkxaS=cPY1FA@mail.gmail.com>
URL: https://gitlist.dev/e/CADGzKpxJ7_5htGVgHfvU-caPTm2tLxmCvuc-RoYkxaS%3DcPY1FA%40mail.gmail.com

```
Hi,
I want to inform you about the fact when I changed a branch with VS
Code open and git did not have permissions to address some files in
the other branch (or in current branch). I got an error message. That
is OK, but my current branch got also polluted with files (from the
other branch?). I needed to run “git stash -u” to get rid of those.

I guess this can be reproduced if one locks a file which is in a
branch and changes the branch. Better functionality would be that git
would only show the error message, not to pollute the branch with
files.

Yours,
Antti Tanskanen

```
