dep init
fails if a required package is checked out in GOPATH with a version not in origin #373
Description
At least, I think that's what's happening here.
This is with dep version 3ef7bf8.
In a project which uses github.com/golang/protobuf, I ran dep init
. It errored with this message:
safe write of manifest and lock: error while writing out vendor tree: error while exporting github.com/golang/protobuf: fatal: failed to unpack tree object 32d172e1d23fd527e941c717dee7555aa5948b38
: exit status 128
I ran cd $GOPATH/src/github.com/golang/protobuf
, and checked, and yes - I am checked out to that commit:
-> % git rev-parse HEAD
32d172e1d23fd527e941c717dee7555aa5948b38
This happens to be the SHA of the head commit of a branch I was working on, https://github.com/spenczar/protobuf/tree/codegen_convention. It's not yet in the upstream repo.
I ran git checkout master
in $GOPATH/src/github.com/golang/protobuf
, returned to the original project, ran dep init
, and then everything was fine again.
I didn't expect that the state of packages in GOPATH would have an impact on how dep init works (I figured it would treat remotes as the authorities), so I'm making a bug report.