Re: Alternates corruption issue
Jeff King <peff@peff.net> writes:
Show 12 quoted lines
> I believe that would work in your case, but it seems like the most
> correct thing would actually be:
>
> { "", "/.git", ".git" }
>
> That is:
>
> 1. Try the literal path the user gave as a repo
>
> 2. Otherwise, try it as the root of a working tree (containing .git)
>
> 3. Otherwise, assume they were too lazy to type ".git" and include itThat sounds sensible, together with this, to which I agree with:
> One way of dealing with that would be to make get_repo_path a little
> more robust by only selecting paths which actually look like git
> directories.
Show 10 quoted lines
> diff --git a/builtin/clone.c b/builtin/clone.c
> index 9084feb..0fbbae9 100644
> --- a/builtin/clone.c
> +++ b/builtin/clone.c
> @@ -108,7 +108,7 @@ static const char *argv_submodule[] = {
>
> static char *get_repo_path(const char *repo, int *is_bundle)
> {
> - static char *suffix[] = { "/.git", ".git", "" };
> + static char *suffix[] = { "/.git", "", ".git" };... this does not match that simple and clear guideline.
Shouldn't this simply be { "", "/.git", ".git" }?Show 11 quoted lines
> diff --git a/path.c b/path.c
> index b6f71d1..1ca6567 100644
> --- a/path.c
> +++ b/path.c
> @@ -293,7 +293,7 @@ const char *enter_repo(const char *path, int strict)
>
> if (!strict) {
> static const char *suffix[] = {
> - ".git/.git", "/.git", ".git", "", NULL,
> + "/.git", "", ".git/.git", ".git", NULL,
> };Neither does this.
Shouldn't this be { "", "/.git", ".git", ".git/.git", NULL }?I must be missing something from your description...