8000 GitHub Β· Where software is built
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.
"reference has changed concurrently" when using examples/pullΒ #1230
@psidex

Description

@psidex

To reproduce:

  • Clone any Github repository using git
  • Make a change to the repository on Github (not locally)
  • Build the pull example
  • Run the example with an argument which is the path to the cloned repository

I get this output:

git pull origin
error: reference has changed concurrently

After the above error occurs, running the command git pull using my installed version of git on the repo shows this:

error: cannot lock ref 'refs/remotes/origin/master': unable to resolve reference 'refs/remotes/origin/master': reference broken

If the repository is not updated on Github (so has nothing to pull), it runs successfully and returns already up-to-date


This is the full output if I change the code to send the progress tostdout:

Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Compressing objects: 100% (3/3), done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
error: reference has changed concurrently

Compared to the output of the actual git command on my system:

C:\folder> git pull
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 2), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.

Something seems to definitely be going wrong.


Versions:

  • go-git.v4
  • go version go1.13.1 windows/amd64

After some more testing I was doing the same thing with a different repository and it was giving me another error, worktree contains unstaged changes.

This seems to be some sort of an incompatibility between the git tool and the go-git library, as cloning & pulling with just go-git works, but cloning with git and then pulling with go-git does not seem to work.

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

      0