diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 83ba8540..30046297 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -2,6 +2,14 @@ All notable changes to this project will be documented in this file. This change == Unreleased (dev) +== 0.11.2 (2021-02-28) + +// {{{ +=== Fixed + +* https://github.com/liquidz/antq/issues/61[#61]: Fixed diff URL for `:git/url` ending with ".git" to be correct +// }}} + == 0.11.1 (2021-02-06) // {{{ === Fixed diff --git a/pom.xml b/pom.xml index e3cbc5ce..1f841711 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 antq antq - 0.11.1 + 0.11.2 antq Point out your outdated dependencies https://github.com/liquidz/antq diff --git a/src/antq/diff/git_sha.clj b/src/antq/diff/git_sha.clj index 89b7f6bd..a766ca1b 100644 --- a/src/antq/diff/git_sha.clj +++ b/src/antq/diff/git_sha.clj @@ -11,7 +11,9 @@ (cond (str/starts-with? url "https://github.com/") (format "%scompare/%s...%s" - (u.url/ensure-tail-slash url) + (-> url + (u.url/ensure-git-https-url) + (u.url/ensure-tail-slash)) (:version dep) (:latest-version dep)) diff --git a/test/antq/diff/git_sha_test.clj b/test/antq/diff/git_sha_test.clj index 85fb2da0..442e74cb 100644 --- a/test/antq/diff/git_sha_test.clj +++ b/test/antq/diff/git_sha_test.clj @@ -16,5 +16,9 @@ (t/testing "missing extra" (t/is (nil? (diff/get-diff-url (dissoc dep :extra))))) + (t/testing "URL ending with .git" + (t/is (= "https://github.com/bar/baz/compare/1.0...2.0" + (diff/get-diff-url (assoc-in dep [:extra :url] "https://github.com/bar/baz.git"))))) + (t/testing "not supported extra URL" (t/is (nil? (diff/get-diff-url (assoc-in dep [:extra :url] "INVALID")))))))