mirror of
https://github.com/logseq/logseq.git
synced 2026-04-24 14:14:55 +00:00
feat: use HEAD as default hash in version selector
This commit is contained in:
@@ -49,7 +49,7 @@
|
||||
[versions path get-content]
|
||||
(let
|
||||
[[content set-content!] (rum/use-state nil)
|
||||
[hash set-hash!] (rum/use-state nil)]
|
||||
[hash set-hash!] (rum/use-state "HEAD")]
|
||||
(rum/use-effect! (fn [] (p/let [c (get-content hash path)] (set-content! c)) [hash path]))
|
||||
[:div.flex
|
||||
[:div.overflow-y-auto {:class "w-48 max-h-[calc(85vh_-_4rem)] "}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
"Git related handler fns"
|
||||
(:require [clojure.string :as string]
|
||||
[electron.ipc :as ipc]
|
||||
[frontend.config :as config]
|
||||
[frontend.db :as db]
|
||||
[frontend.handler.notification :as notification]
|
||||
[frontend.state :as state]
|
||||
@@ -59,15 +58,6 @@
|
||||
:else
|
||||
(run-cli-command! command args)))))
|
||||
|
||||
;; git show $REV:$FILE
|
||||
(defn- get-versioned-file-content
|
||||
[hash path]
|
||||
(when (and hash path)
|
||||
(let [repo (state/get-current-repo)
|
||||
local-dir (config/get-local-dir repo)
|
||||
path (string/replace path (str local-dir "/") "")]
|
||||
(p/let [content (run-git-command! ["show" (str hash ":" path)])]
|
||||
(state/pub-event! [:modal/display-file-version path content hash])))))
|
||||
|
||||
(defn get-file-latest-git-log
|
||||
[page n]
|
||||
|
||||
Reference in New Issue
Block a user