Skip to content

Git "ref" parameter described as taking a ref, but is a tag or branch name only #341

@tomqwpl

Description

@tomqwpl

The documentation for the "ref" parameter is

The Git ref to checkout. This is a ref, so it can point to a commit SHA, a branch name, etc. If it is a named ref such as a branch name, go-getter will update it to the latest on each get.

However the implementation is to call the "--branch" option on the git command line, meaning that it has to be either a branch or tag name. The implementation of --branch in git is to list through the refs, finding either "refs/heads/" (for priority) or "refs/tags/".

Experimentation also shows that you can't pass a SHA, or string such as "refs/heads/master" etc, you can only pass a branch name or tag name. There are tests in go-getter that test the ref parameter being a branch name or a tag name, but nothing further also.

So I think the documentation needs clarifying here.

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