chore: remove duplicated get-repo-branch

pull/645/head
Tienson Qin 2020-11-11 16:58:18 +08:00
parent 9a4c06b132
commit f28d55a358
2 changed files with 1 additions and 10 deletions

View File

@ -14,7 +14,7 @@
(defn get-remote-ref (defn get-remote-ref
[repo-url] [repo-url]
(let [branch (state/get-repo-branch repo-url)] (let [branch (state/get-default-branch repo-url)]
;; TODO: what if the remote is not named "origin", check the api from isomorphic-git ;; TODO: what if the remote is not named "origin", check the api from isomorphic-git
(git/resolve-ref repo-url (str "refs/remotes/origin/" branch)))) (git/resolve-ref repo-url (str "refs/remotes/origin/" branch))))

View File

@ -210,15 +210,6 @@
[] []
(get-in @state [:me :repos])) (get-in @state [:me :repos]))
(defn get-repo-branch
[repo-url]
(or
(->> (get-repos)
(filter (fn [repo] (= (:url repo) repo-url)))
first
:branch)
"master"))
(defn set-current-repo! (defn set-current-repo!
[repo] [repo]
(swap! state assoc :git/current-repo repo) (swap! state assoc :git/current-repo repo)