Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when cloning from root without specifying an explicit repository name #1201

Closed
0x53A opened this issue Jun 6, 2018 · 4 comments
Closed

Comments

@0x53A
Copy link
Contributor

0x53A commented Jun 6, 2018

I need to clone a complete repository.

Version: master (built from source)
Command: quick-clone http://##srv##:8080/tfs/visualstudio $/
Failure: Der Pfad hat ein ungültiges Format. (The path format is invalid)

I debugged a little bit into it, and found that the exception came from Clone.cs

With the following change, it almost works:

grafik

Now it created my repo in .\repo\repo\.git, but except for that little "cosmetic error" cloning worked. I did not yet test anything else. Will probably test commiting tomorrow ...

Looking through the history, there have been a few attempts regarding this, in 2014 it seemed to work for one person, and I found a PR that fixed it, so I guess this is a regression?

Do you know more about this already, or should I investigate and maybe send a PR?

@fourpastmidnight
Copy link
Contributor

Question: where are you running git-tfs from? A Windows Command shell, or a Bash command shell? Specifically, from git-for-windows Mintty terminal running Bash?

I ask because this is a common issue when running from MinTTY terminal in Bash because the MinGW framework does "automagic" path conversion to convert things that "look like" a Unix path to a Windows-y path.

The solution in this case, is to prefix your command with MSYS_NO_PATHCONV=1. For example:

$ MSYS_NO_PATHCONV=1 git tfs quick-clone http://##srv##:8080/tfs/visualstudio "$/"

HTH.

@fourpastmidnight
Copy link
Contributor

As for cloning and repo naming, technically, there's no name for $/, so git-tfs doesn't know what to name the repository. The solution is to explicitly provide a name. I have done this and I can verify that this does work. For example:

$ MSYS_NO_PATHCONV=1 git tfs quick-clone http://##srv##:8080/ttfs/visualstudio "$/" MyRepoName

HTH.

@0x53A
Copy link
Contributor Author

0x53A commented Jun 6, 2018

  1. powershell on windows, but I debugged into it and it passes the parameters correctly.

  2. That probably works, because the issue is in the code that (tries to) infer the name from the path.

So the correct "fix" is to error out with a nice message if: Path is root, but no explicit repo name has been specified.

Thank you!

@0x53A 0x53A changed the title Cloning from root is broken (again) Error when cloning from root without specifying an explicit repository name Jun 6, 2018
@pmiossec
Copy link
Member

pmiossec commented Jun 6, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants