Re: Git repository name-guessing corner case
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:54:02
Joseph Chiu [off-list ref] writes:
On the south machine, I first accidentally created the repo wizard.git.git (note the double .git), with ...
We have updated the logic around this area with b3256eb (standardize
and improve lookup rules for external local repos, 2012-02-02), and
this is part of v1.7.9.2 and later releases. The rule used to be
(1) check with "/.git" appended, to cover the case where you access
a repository with a working tree attached, (2) check with ".git"
appended, and then (3) check without anything appended. It was very
error prone to cause exactly the above kind of gotchas.
The updated rule checks with "/.git" first andthe next possibility
that is checked is the given name without modification, so if you
have both wizard.git and wizard.git.git (with or without working
tree):
accessing with this name ... will find this repository
wizard wizard.git
wizard.git wizard.git
wizard.git.git wizard.git.git
which should be much saner.