Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Support SHA1 in source of RefSpec for fetch #628

Open
@bgardiner

Description

@bgardiner

If uploadpack.allowReachableSHA1InWant is True on the git server, a fetch request can specify a SHA1 in the want line. I do not believe Fetch currently supports specifying a SHA1 as the source refspec. When attempting this, there is no fetch performed and I receive a NoErrAlreadyUpToDate. For example:

refspec := config.RefSpec(fmt.Sprintf("%v:%v", reference.Hash().String(), "refs/remotes/name/branch"))
	if err = r.FetchContext(ctx, &git.FetchOptions{
		RemoteName: "name",
		RefSpecs:   []config.RefSpec{refspec},
		Depth:      1,
		Auth:       auth,
	}); err != nil {
		return errors.Wrap(err)

I'm using v4.0.0-rc15 (the latest release) of the package. Am I not specifying the RefSpec correctly or is this a limitation in the current implementation?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions