libgit2 / libgit2/libgit2sharp
Cloning pathing
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 3.5k
- Forks
- 925
- PR merge metrics
- No merged PRs in 30d
Description
After cloning a path like so:
DirectoryInfo dir = new DirectoryInfo("C:/APath/SomeOtherPath/");
Repository.Clone(dir.FullName, "Some other path");
The dir.FullName returns "C:\APath\SomeOtherPath" instead of forward slashes. The clone code runs correctly, but then trying to push from the clone back to the remote repo (using Git Extensions) gives a locational error saying it cannot locate the repository.
By making the modification to
Repository.Clone(dir.FullName.Replace('','/'), "Some other path");
it was able to find the repo when pushing.
It would be a nice feature to have the slashes standardized to forward slash -INSIDE- the Clone function, or at least throw an error saying it's not going to link properly, etc.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Repository.Clone entry point described in the issue and reproduce the Windows-path example using DirectoryInfo.FullName. Verify the cloned repository can be used for a subsequent push without requiring callers to replace backslashes; the issue is done when this scenario works or a clear validation error is produced.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, git
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100