Skip to content

Performance issue with repository owner check #6649

@csware

Description

@csware

The owner check

static int validate_ownership_cb(const git_config_entry *entry, void *payload)
adds a significant performance issue, because the path normalization git_fs_path_prettify_dir
if (git_fs_path_prettify_dir(&data->tmp, test_path, NULL) == 0 &&
is called for every safe.directory value in .gitconfig.

Reproduction steps

Have many safe.directory entries in .gitconfig, potentially several pointing to unavailable UNC-paths such as %(prefix)///192.168.123.123/Foo/bar/repo1 or NFS shares.

libgit2 will contact each of those for path validation.

Version of libgit2 (release number or SHA1)

All since be3a78c

Operating system(s) tested

Windows 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions