diff --git a/CHANGELOG.md b/CHANGELOG.md index 5035a23..85c8d0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ See the [New Clojure project quickstart](https://blog.michielborkent.nl/new-cloj - [#230](https://github.com/babashka/neil/issues/230): neil dep upgrade inserts git/url into upgraded dep ([@teodorlu](https://github.com/teodorlu)) - [#237](https://github.com/babashka/neil/issues/230): more specific error reporting on invalid github token ([@teodorlu](https://github.com/teodorlu)) +- [#235](https://github.com/babashka/neil/issues/230): neil dep upgrade changes git url ([@teodorlu](https://github.com/teodorlu)) ## 0.3.66 diff --git a/src/babashka/neil.clj b/src/babashka/neil.clj index d58c02d..7888c00 100644 --- a/src/babashka/neil.clj +++ b/src/babashka/neil.clj @@ -726,7 +726,7 @@ details on the search syntax."))) version (assoc :version version) tag (assoc :tag tag) (and (not tag) sha) (assoc :sha sha) - (not (:git/url current)) (assoc :omit-git-url true))})))))) + true (assoc :omit-git-url true))})))))) (defn dep-upgrade [{:keys [opts]}] (when (or (:h opts) (:help opts)) diff --git a/test/babashka/neil/dep_upgrade_test.clj b/test/babashka/neil/dep_upgrade_test.clj index 823f531..d7cc374 100644 --- a/test/babashka/neil/dep_upgrade_test.clj +++ b/test/babashka/neil/dep_upgrade_test.clj @@ -277,3 +277,13 @@ (is (neil/dep->upgrade {:lib 'com.wsscode/pathom3 :current {:mvn/version "2023.01.31-alpha"} :unstable true}))) + +(deftest neil-dep-upgrade-does-not-change-git-urls + (testing "When we upgrade a dep with :git/url, we don't want that git url shall not change." + (let [original-git-url "https://github.com/babashka/babashka.pods" + original-deps {:deps {'babashka/pods {:git/url original-git-url + :git/sha "6ad6045b94bc871c5107bfc75d39643b6c1bc8ba"}}}] + (spit test-file-path original-deps) + (test-util/neil "dep upgrade" :test-file-path test-file-path) + (is (= original-git-url + (:git/url (get-dep-version 'babashka/pods)))))))