threads / bug / 38660

git probably bug

Subject: git probably bug

## tl;dr

2 messages between Feb 26, 2015 and Feb 26, 2015.

replies: 1people: 2as markdown or json

Виталий Бормотов· Feb 26, 2015, 19:39 UTC · lore

Hello. Thanks for the git, it is powerful, fast and nice to use. I've probably found a bug. When checking out into some different state, if there is no permissions to unlink files (if some files in the current state doesn't exist in the new) warnings are outputing, but then git says that checking out is successful, shows that we are in the new state and the non-unlinked files are marked as untracked. In my case. there was whole directories only, i don't know about this error when we cannot unlink different files or when the denied operation is not file removing (but it seems like the error is about unlinking only).

My git version is 2.1.0.
I've found your email at  https://github.com/git/git/blob/master/README#L45  and don't know about any other bugtrackers.

Best regards, Vitaly Bormotov aka Quilfe.

Junio C Hamano· Feb 26, 2015, 21:36 UTC · re: Виталий Бормотов · lore

Re: git probably bug

Виталий Бормотов  <bormvit@mail.ru> writes:
Show 6 quoted lines
> When checking out into some different
> state, if there is no permissions to unlink files (if some files in
> the current state doesn't exist in the new) warnings are outputing,
> but then git says that checking out is successful, shows that we are
> in the new state and the non-unlinked files are marked as
> untracked.

This is done by reasonably old part of the codebase, and I think it is exactly working as designed. Unlinking of an existing path in the filesystem is done for one of the two reasons:

 - The old tree has the path, the new tree does not.
 - The old tree has the path, the new tree has it but with a
   different content.

In both cases, we first attempt to unlink (and warn if we cannot) and then attempt to create the path with the new contents in the latter case (and die if we cannot).

The checkout itself succeeds, because having untracked cruft in your working tree is not an error, but warnings are given to let you know that you may want to remove them after fixing the screwy permission problem yourself.

← back to recent threads