Browse Source

chore: remove duplicated get-repo-branch

Tienson Qin 5 years ago
parent
commit
f28d55a358
2 changed files with 1 additions and 10 deletions
  1. 1 1
      src/main/frontend/handler/common.cljs
  2. 0 9
      src/main/frontend/state.cljs

+ 1 - 1
src/main/frontend/handler/common.cljs

@@ -14,7 +14,7 @@
 
 (defn get-remote-ref
   [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
     (git/resolve-ref repo-url (str "refs/remotes/origin/" branch))))
 

+ 0 - 9
src/main/frontend/state.cljs

@@ -210,15 +210,6 @@
   []
   (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!
   [repo]
   (swap! state assoc :git/current-repo repo)