Add push error debugger

pull/645/head
Tienson Qin 2020-10-12 11:59:58 +08:00
parent 8a341da733
commit 0c6fd69354
1 changed files with 44 additions and 41 deletions

View File

@ -402,7 +402,7 @@
(db/cloned? repo-url)
(not= status :pulling)
(not (state/get-edit-input-id)))
(p/let [files (js/window.workerThread.getChangedFiles (util/get-repo-dir (state/get-current-repo)))]
(-> (p/let [files (js/window.workerThread.getChangedFiles (util/get-repo-dir (state/get-current-repo)))]
(when (or (seq files) fallback? diff-push?)
;; auto commit if there are any un-committed changes
(let [commit-message (if (string/blank? commit-message)
@ -437,7 +437,10 @@
(git-handler/set-git-error! repo-url error)
(if permission?
(show-install-error! repo-url (util/format "Failed to push to %s. " repo-url))
(pull repo-url token {:force-pull? true})))))))))))))))
(pull repo-url token {:force-pull? true}))))))))))))
(p/catch (fn [error]
(println "Git push error: ")
(js/console.dir error)))))))
(defn pull-current-repo
[]