diff --git a/src/nimblepkg/download.nim b/src/nimblepkg/download.nim index 1310886..5e6506f 100644 --- a/src/nimblepkg/download.nim +++ b/src/nimblepkg/download.nim @@ -174,13 +174,10 @@ proc doDownload*(url: string, downloadDir: string, verRange: VersionRange, if verRange.spe == newSpecial(getHeadName(downMethod)): doClone(downMethod, url, downloadDir) # Grab HEAD. else: - # Mercurial requies a clone and checkout. The git clone operation is - # already fragmented into multiple steps so we just call doClone(). - if downMethod == DownloadMethod.git: - doClone(downMethod, url, downloadDir, $verRange.spe) - else: - doClone(downMethod, url, downloadDir, tip = false) - doCheckout(downMethod, downloadDir, $verRange.spe) + # Grab the full repo. + doClone(downMethod, url, downloadDir, tip = false) + # Then perform a checkout operation to get the specified branch/commit. + doCheckout(downMethod, downloadDir, $verRange.spe) result = verRange else: case downMethod diff --git a/tests/tester.nim b/tests/tester.nim index 3f5a51d..3aa669d 100644 --- a/tests/tester.nim +++ b/tests/tester.nim @@ -22,6 +22,10 @@ proc inLines(lines: seq[string], line: string): bool = for i in lines: if line.normalize in i.normalize: return true +test "issue 129 (installing commit hash)": + check execCmdEx(path & " install -y \"https://github.com/nimble-test/packagea.git@#1f9cb289c89\""). + exitCode == QuitSuccess + test "issue 113 (uninstallation problems)": cd "issue113/c": check execCmdEx("../../" & path & " install -y").exitCode == QuitSuccess