Skip to content

git_repository_init_ext doesn't return when non-existent path contains subdirectory #5013

Description

@bording

Originally reported in libgit2/libgit2sharp#1664, it appears that git_repository_init_ext never returns if the path passed in via repo_path contain a subdirectory.

For example, passing in c:\foo when it doesn't exist works fine. Passing in c:\foo\foo when c:\foo doesn't exist causes it to never return.

For drives that don't exist, x:\foo returns the appropriate error. x:\foo\foo never returns.

Reproduction steps

Here's how it's being called from LibGit2Sharp:
https://github.com/libgit2/libgit2sharp/blob/72a5be4860779e5d2fd6d2900d3dcc119588fbc9/LibGit2Sharp/Core/Proxy.cs#L2471-L2484

Expected behavior

git_repository_init_ext should return with appropriate error code.

Actual behavior

git_repository_init_ext never returns

Version of libgit2 (release number or SHA1)

572e4d8

Operating system(s) tested

Win10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions