Skip to content

Parsing of refspec in remote fetch configuration different from git #5058

Closed

Description

@tmat

Based on an issue reported in dotnet/sourcelink#256.

Reproduction steps

Add a configuration entry like so:

[remote "origin"]
        url = https://github.com/somerepo.git
        fetch = +refs/heads/package-*:refs/remotes/origin/package-*

and read remotes information using libgit2 APIs.

The issue is that the fetch refspec does not end with /*. libgit2 is able to read the configuration if the refspec does end with /*.

fetch = +refs/heads/package/*:refs/remotes/origin/package/*

Expected behavior

Succeeds.

Actual behavior

'+refs/heads/package-*:refs/remotes/origin/package-*' is not a valid refspec.

Version of libgit2 (release number or SHA1)

libgit2-a904fc6

Operating system(s) tested

Windows.

Activity

  1. pks-t commented on Apr 26, 2019

    @pks-t
    Member

    Thanks for your report! git.git has indeed changed restrictions on refspecs to allow your scenario in 2015. Please see #5060 for my proposed fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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