Skip to content

Commit aef6f4f

Browse files
yyonchozah
authored andcommitted
Can sync ignoring deps not present in lock file even if they are in develop file
1 parent 25d6e4a commit aef6f4f

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/nimble.nim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1761,7 +1761,9 @@ proc sync(options: Options) =
17611761
findValidationErrorsOfDevDepsWithLockFile(pkgInfo, options, errors)
17621762

17631763
for name, error in common.dup(errors):
1764-
if error.kind == vekWorkingCopyNeedsSync:
1764+
if not pkgInfo.lockedDeps.contains(name):
1765+
errors.del name
1766+
elif error.kind == vekWorkingCopyNeedsSync:
17651767
if not options.action.listOnly:
17661768
syncWorkingCopy(name, error.path, pkgInfo, options)
17671769
else:

tests/tlockfile.nim

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,3 +551,15 @@ requires "nim >= 1.5.1"
551551
writeDevelopFile(developFileName, @[],
552552
@[dep2PkgRepoPath, mainPkgRepoPath, dep1PkgRepoPath])
553553
testLockFile(@[(dep1PkgName, dep1PkgRepoPath)], isNew = true)
554+
555+
test "can sync ignoring deps not present in lock file even if they are in develop file":
556+
cleanUp()
557+
withPkgListFile:
558+
initNewNimblePackage(mainPkgOriginRepoPath, mainPkgRepoPath,
559+
@[dep1PkgName])
560+
initNewNimblePackage(dep1PkgOriginRepoPath, dep1PkgRepoPath)
561+
cd mainPkgRepoPath:
562+
testLockFile(@[(dep1PkgName, dep1PkgRepoPath)], isNew = true)
563+
writeDevelopFile(developFileName, @[], @[dep1PkgRepoPath, mainPkgOriginRepoPath])
564+
let (_, exitCode) = execNimbleYes("--debug", "--verbose", "sync")
565+
check exitCode == QuitSuccess

0 commit comments

Comments
 (0)