Skip to content

Commit

Permalink
chore: do not print error when resolving git ref failed
Browse files Browse the repository at this point in the history
  • Loading branch information
gyk authored and tiensonqin committed Dec 10, 2020
1 parent 06de259 commit c300ed7
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions src/main/frontend/handler/common.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
[frontend.util :as util]
[frontend.text :as text]
[frontend.git :as git]
[frontend.db :as db]))
[frontend.db :as db]
[lambdaisland.glogi :as log]))

(defn get-ref
[repo-url]
Expand All @@ -28,17 +29,20 @@
(gobj/get js/window "workerThread")
(gobj/get js/window.workerThread "getChangedFiles"))
(->
(p/let [files (js/window.workerThread.getChangedFiles (util/get-repo-dir repo))]
(let [files (bean/->clj files)]
(p/let [remote-latest-commit (get-remote-ref repo)
local-latest-commit (get-ref repo)
descendent? (git/descendent? repo local-latest-commit remote-latest-commit)
diffs (git/get-diffs repo local-latest-commit remote-latest-commit)]
(let [files (if descendent?
(->> (concat (map :path diffs) files)
distinct)
files)]
(state/set-changed-files! repo files)))))
(p/let [files (js/window.workerThread.getChangedFiles (util/get-repo-dir repo))
files (bean/->clj files)]
(->
(p/let [remote-latest-commit (get-remote-ref repo)
local-latest-commit (get-ref repo)]
(p/let [descendent? (git/descendent? repo local-latest-commit remote-latest-commit)
diffs (git/get-diffs repo local-latest-commit remote-latest-commit)]
(let [files (if descendent?
(->> (concat (map :path diffs) files)
distinct)
files)]
(state/set-changed-files! repo files))))
(p/catch (fn [error]
(log/warn :git/ref-not-found {:error error})))))
(p/catch (fn [error]
(js/console.dir error)))))))

Expand Down

0 comments on commit c300ed7

Please sign in to comment.