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

Commit 51d77e8

Browse files
committed
cmd/dep: update out-of-sync error message in ensure
Signed-off-by: Ibrahim AshShohail <[email protected]>
1 parent da061e9 commit 51d77e8

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

cmd/dep/ensure.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ func (cmd *ensureCommand) runUpdate(ctx *dep.Ctx, args []string, p *dep.Project,
333333
// "pending" changes, or the -update that caused the problem?).
334334
// TODO(sdboyer) reduce this to a warning?
335335
if !bytes.Equal(p.Lock.InputHash(), solver.HashInputs()) {
336-
return errors.Errorf("%s and %s are out of sync. Run a plain dep ensure to resync them before attempting to -update", dep.ManifestName, dep.LockName)
336+
return errors.Errorf("%s is out of sync with either %s or the project code. Run a plain dep ensure to resync them before attempting to -update", dep.LockName, dep.ManifestName)
337337
}
338338

339339
// When -update is specified without args, allow every dependency to change
@@ -428,7 +428,7 @@ func (cmd *ensureCommand) runAdd(ctx *dep.Ctx, args []string, p *dep.Project, sm
428428
// "pending" changes, or the -add that caused the problem?).
429429
// TODO(sdboyer) reduce this to a warning?
430430
if p.Lock != nil && !bytes.Equal(p.Lock.InputHash(), solver.HashInputs()) {
431-
return errors.Errorf("%s and %s are out of sync. Run a plain dep ensure to resync them before attempting to -add", dep.ManifestName, dep.LockName)
431+
return errors.Errorf("%s is out of sync with either %s or the project code. Run a plain dep ensure to resync them before attempting to -add", dep.LockName, dep.ManifestName)
432432
}
433433

434434
rm, _ := params.RootPackageTree.ToReachMap(true, true, false, p.Manifest.IgnoredPackages())

cmd/dep/testdata/harness_tests/ensure/add/errs/desync/testcase.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"commands": [
33
["ensure", "-add", "foobar.com/baz"]
44
],
5-
"error-expected": "Gopkg.toml and Gopkg.lock are out of sync. Run a plain dep ensure to resync them before attempting to -add"
5+
"error-expected": "Gopkg.lock is out of sync with either Gopkg.toml or the project code. Run a plain dep ensure to resync them before attempting to -add"
66
}

cmd/dep/testdata/harness_tests/ensure/update/errs/desync/testcase.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"commands": [
33
["ensure", "-update"]
44
],
5-
"error-expected": "Gopkg.toml and Gopkg.lock are out of sync. Run a plain dep ensure to resync them before attempting to -update"
5+
"error-expected": "Gopkg.lock is out of sync with either Gopkg.toml or the project code. Run a plain dep ensure to resync them before attempting to -update"
66
}

0 commit comments

Comments
 (0)