mirror of https://github.com/logseq/logseq
chore: remove duplicated get-repo-branch
parent
9a4c06b132
commit
f28d55a358
|
@ -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))))
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue