Re: Error when cloning with weird local directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2015-08-06 06.21, Chris Packham wrote:
> Hi All,
> 
> A developer at $dayjob called me over to have a look at a git error he
> was getting (names changed to protect the innocent).
> 
>   $ git --version
>   git version 2.5.0
>   $ git clone ssh://example.com/repo.git
>   Cloning into 'repo'...
>   fatal: I don't handle protocol '/home/user/src/ssh'
> 
> After a bit of head scratching we found that he had a local directory
> structure called 'ssh://example.com/repo.git' it wasn't a complete
> repo but it had some of the things one expects to find in a .git
> directory (info, objects, refs, etc). It had been there for a while
> and we suspect was created by a scp gone wrong from the last time he
> was dealing with repo.git.
> 
> I'm wondering if it's worth catching this kind of weirdness and
> erroring out with a slightly more useful message. I'm also wondering
> what would have happened if this repo was actually a full and complete
> thing.
> 
> I'm not sure that there is a problem worth solving here. I can provide
> an anonymized tarball of the directory structure in question if anyone
> is interested. But maybe this is useful for future mailing list
> searchers[1].
> 
> Thanks,
> Chris
This is indeed a bug:

It looks as if
static char *get_repo_path(const char *repo, int *is_bundle)
in built/clone.c
checks if there is a local directory structure looking like a
.git directory.
This is wrong.
There should be a check for the scheme first.


It is not the error message that is confusing, we should never get there,
but invoke ssh instead.

The bug is in clone.c

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]