Skip to content

"Not a valid refspec" error during build with a specific configured remote.x.fetch refspec #256

@kkm000

Description

@kkm000
  • Package version 1.0.0-beta2-18618-05, currently latest.
  • VS 15.9.9
  • Git version 2.16.2.windows.1

Both net45 and netstandard1.3 targets behave identically.

I have the following fragment in .git/config setting up fetched branches from remotes:

[remote "golden"]
        url = git://github.com/grpc/grpc.git
        fetch = +refs/heads/master:refs/remotes/golden/master
        fetch = +refs/heads/v1.17.x:refs/remotes/golden/v1.17.x
[remote "origin"]
        url = ssh://github.com/kkm000/grpc.git
        fetch = +refs/heads/kkm/*:refs/remotes/origin/kkm/*
        fetch = +refs/heads/package-*:refs/remotes/origin/package-*

When I attempt to build the project, I am getting the following error (split in 2 lines for the ease of reading):

C:\Users\kkm\.nuget\packages\microsoft.build.tasks.git\1.0.0-beta2-18618-05\build\Microsoft.Build.Tasks.Git.targets(28,5):
 error : '+refs/heads/package-*:refs/remotes/origin/package-*' is not a valid refspec.

Naturally, when I disable the last fetch line in the above snippet, build succeeds.

Git does not object to this refspec, and the version I have is not quite even the latest; in fact, the configuration has been there for a very long time. The Microsoft.Build.Tasks.Git may have been updated upstream, though (I just came back to work on this project after a few month long hiatus).

I hope I've provided enough info, but please @ me if more is required!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions