diff --git a/src/nimble.nim b/src/nimble.nim index 2e4b17a6..25a54790 100644 --- a/src/nimble.nim +++ b/src/nimble.nim @@ -1761,7 +1761,9 @@ proc sync(options: Options) = findValidationErrorsOfDevDepsWithLockFile(pkgInfo, options, errors) for name, error in common.dup(errors): - if error.kind == vekWorkingCopyNeedsSync: + if not pkgInfo.lockedDeps.contains(name): + errors.del name + elif error.kind == vekWorkingCopyNeedsSync: if not options.action.listOnly: syncWorkingCopy(name, error.path, pkgInfo, options) else: diff --git a/tests/tlockfile.nim b/tests/tlockfile.nim index 416eb0f4..95c592a5 100644 --- a/tests/tlockfile.nim +++ b/tests/tlockfile.nim @@ -551,3 +551,15 @@ requires "nim >= 1.5.1" writeDevelopFile(developFileName, @[], @[dep2PkgRepoPath, mainPkgRepoPath, dep1PkgRepoPath]) testLockFile(@[(dep1PkgName, dep1PkgRepoPath)], isNew = true) + + test "can sync ignoring deps not present in lock file even if they are in develop file": + cleanUp() + withPkgListFile: + initNewNimblePackage(mainPkgOriginRepoPath, mainPkgRepoPath, + @[dep1PkgName]) + initNewNimblePackage(dep1PkgOriginRepoPath, dep1PkgRepoPath) + cd mainPkgRepoPath: + testLockFile(@[(dep1PkgName, dep1PkgRepoPath)], isNew = true) + writeDevelopFile(developFileName, @[], @[dep1PkgRepoPath, mainPkgOriginRepoPath]) + let (_, exitCode) = execNimbleYes("--debug", "--verbose", "sync") + check exitCode == QuitSuccess