From 6f684289158d401d2fae95b74e31158da37719ee Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz Date: Wed, 10 Dec 2014 00:13:20 +0100 Subject: [PATCH] Fixes git command line install for a specific tag. Refs #70. --- src/nimblepkg/download.nim | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/nimblepkg/download.nim b/src/nimblepkg/download.nim index 4768a71..e69d0d1 100644 --- a/src/nimblepkg/download.nim +++ b/src/nimblepkg/download.nim @@ -175,11 +175,13 @@ proc doDownload*(url: string, downloadDir: string, verRange: PVersionRange, if verRange.spe == newSpecial(getHeadName(downMethod)): doClone(downMethod, url, downloadDir) # Grab HEAD. else: - # We don't know if we got a commit hash or a branch here, and - # we can't clone a specific commit (with depth 1) according to: - # http://stackoverflow.com/a/7198956/492186 - doClone(downMethod, url, downloadDir, tip = false) - doCheckout(downMethod, downloadDir, $verRange.spe) + # Mercurial requies a clone and checkout. The git clone operation is + # already fragmented into multiple steps so we just call doClone(). + if downMethod == TDownloadMethod.Git: + doClone(downMethod, url, downloadDir, $verRange.spe) + else: + doClone(downMethod, url, downloadDir, tip = false) + doCheckout(downMethod, downloadDir, $verRange.spe) else: case downMethod of TDownloadMethod.Git: