mirror of https://github.com/logseq/logseq
fix: don't git push when it's already pushing
parent
ebb4e4c745
commit
cdba94dae7
|
@ -387,9 +387,12 @@
|
||||||
commit-push? false
|
commit-push? false
|
||||||
force? false}}]
|
force? false}}]
|
||||||
(let [status (db/get-key-value repo-url :git/status)]
|
(let [status (db/get-key-value repo-url :git/status)]
|
||||||
(when (and
|
(when (or
|
||||||
(db/cloned? repo-url)
|
commit-push?
|
||||||
(not (state/get-edit-input-id)))
|
(and
|
||||||
|
(db/cloned? repo-url)
|
||||||
|
(not (state/get-edit-input-id))
|
||||||
|
(not= status :pushing)))
|
||||||
(-> (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
|
(when (or
|
||||||
commit-push?
|
commit-push?
|
||||||
|
@ -419,6 +422,7 @@
|
||||||
(and permission? (not fallback?))
|
(and permission? (not fallback?))
|
||||||
(request-app-tokens!
|
(request-app-tokens!
|
||||||
(fn []
|
(fn []
|
||||||
|
(git-handler/set-git-status! repo-url :re-push)
|
||||||
(push repo-url
|
(push repo-url
|
||||||
{:commit-message commit-message
|
{:commit-message commit-message
|
||||||
:fallback? true}))
|
:fallback? true}))
|
||||||
|
@ -439,6 +443,8 @@
|
||||||
nil)))))))))))
|
nil)))))))))))
|
||||||
(p/catch (fn [error]
|
(p/catch (fn [error]
|
||||||
(println "Git push error: ")
|
(println "Git push error: ")
|
||||||
|
(git-handler/set-git-status! repo-url :push-failed)
|
||||||
|
(git-handler/set-git-error! repo-url error)
|
||||||
(js/console.dir error)))))))
|
(js/console.dir error)))))))
|
||||||
|
|
||||||
(defn push-if-auto-enabled!
|
(defn push-if-auto-enabled!
|
||||||
|
|
Loading…
Reference in New Issue