This repository was archived by the owner on Sep 9, 2020. It is now read-only.
This repository was archived by the owner on Sep 9, 2020. It is now read-only.
Dep ensure silently updating lock file when encountering an orphaned commit #405
Closed
Description
Small repoducer here: https://github.com/kragniz/deptest
When running dep ensure
on this project, my Gopkg.lock
file gets modified to a different reviesion:
diff --git a/Gopkg.lock b/Gopkg.lock
index b57fc12..6025f24 100644
--- a/Gopkg.lock
+++ b/Gopkg.lock
@@ -7,10 +7,10 @@ memo = "992a6dae47ba88517cb895db7d8863c0b548be912a7fc57c623e77426d789d01"
revision = "4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9"
[[projects]]
- branch = "release-3.1"
name = "github.com/coreos/etcd"
packages = ["auth/authpb","clientv3","etcdserver/api/v3rpc/rpctypes","etcdserver/etcdserverpb","mvcc/mvccpb","pkg/tlsutil"]
- revision = "4dfc6a8a7e15229398c0a018b6d7a078cccae9c8"
+ revision = "e5b7ee2d03627ca33201da428b8110ef7c3e95f1"
+ version = "v3.1.6"
After looking at the verbose output, it appears that dep knows that the lock file references a particular revision, but bails on it:
(1) ✗ Unable to update checked out version: fatal: reference is not a tree: 4dfc6a8a7e15229398c0a018b6d7a078cccae9c8
This commit turned out to be orphaned in etcd/coreos (looks like a force pushed rebase or something).
My assumption here is that dep ensure
should not modify existing revisions in the lock file, so should output an error when encountering situations like this rather than deviating from the revision in the lock file.