Olga Pilipenco <olga.pilipenco@xxxxxxxxxxx> writes: >> Perhaps the logic is clear to those who diagnosed the problem, wrote >> the patch, and reviewed it, in which case there is no reason to >> reroll. Perhaps it was just me to whom it was not obvious that >> the purpose of "is_current" check was not about "are we looking at >> the main worktree" but was about "if we are not in the main worktree, >> we need this extra check". >> >> Thanks. > > You did a great job figuring it out and I agree it's confusing at > first, but we tried our best to make it less confusing. > `is_current` check is actually not necessary there, but having it there saves > extra unnecessary calculations, also describes & fixes the exact scenario > that didn't work (not being able to see main worktree as bare from a > secondary worktree). If I had to do a great job there, then the code does deserve to be explained a bit better for later developers who wonder why it is written in the way it is, perhaps we a single-liner comment? Thanks.