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

Cloning repository on Windows with a file name with a trailing . (dot) fails #2129

Open
TheJoelGray opened this issue Nov 21, 2024 · 0 comments

Comments

@TheJoelGray
Copy link

TheJoelGray commented Nov 21, 2024

Reproduction steps

Attempt to clone a repository on Windows that has a file with a trailing . (dot) in the file name. You can use the example repository with this condition at https://gitlab.com/ThePaleOne/libgit2sharp-test.git. The following code will do this.

var repoUrl = "https://gitlab.com/ThePaleOne/libgit2sharp-test.git";
var _baseDirectory = @"D:\src\test\repo";

Console.WriteLine($"Cloning {repoUrl} to {_baseDirectory}");
Repository.Clone(repoUrl, _baseDirectory);

If you run this code on the same repository on Mac or Linux the repository clones just fine.

The contents of the repository shown below:
image

Expected behavior

Expect the repository to clone properly.

Actual behavior

The clone process fails with this error

cannot checkout to invalid path 'other.test.file.'
   at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) in /_/LibGit2Sharp/Core/Ensure.cs:line 154
   at LibGit2Sharp.Core.Ensure.ZeroResult(Int32 result) in /_/LibGit2Sharp/Core/Ensure.cs:line 172
   at LibGit2Sharp.Core.Proxy.git_clone(String url, String workdir, GitCloneOptions& opts) in /_/LibGit2Sharp/Core/Proxy.cs:line 278
   at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath, CloneOptions options) in /_/LibGit2Sharp/Repository.cs:line 824

Version of LibGit2Sharp (release number or SHA1)

Version 0.30.0

Operating system(s) tested; .NET runtime tested

Windows 11 Version 24H2 (failed)
Debian 11 bullseye (works)
Mac Sequoia 15.1 (works)

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

1 participant