From 4332fb45cbcd7e8299daee7dccc9d4813f2711e1 Mon Sep 17 00:00:00 2001 From: Dmitry Polienko Date: Thu, 29 Dec 2016 17:57:13 +0700 Subject: [PATCH] Fix git ls-remote parsing --- src/nimblepkg/download.nim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nimblepkg/download.nim b/src/nimblepkg/download.nim index cedd648..ea6cff6 100644 --- a/src/nimblepkg/download.nim +++ b/src/nimblepkg/download.nim @@ -91,8 +91,10 @@ proc getTagsListRemote*(url: string, meth: DownloadMethod): seq[string] = raise newException(OSError, "Unable to query remote tags for " & url & ". Git returned: " & output) for i in output.splitLines(): - if i == "": continue - let start = i.find("refs/tags/")+"refs/tags/".len + let refStart = i.find("refs/tags/") + # git outputs warnings, empty lines, etc + if refStart == -1: continue + let start = refStart+"refs/tags/".len let tag = i[start .. i.len-1] if not tag.endswith("^{}"): result.add(tag)