Skip to content

Commit 38cb7a4

Browse files
authored
Fix git backend not working as expected.
1 parent b33b43f commit 38cb7a4

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

call-graph.el

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@
115115

116116
(defcustom call-graph-search-backend nil
117117
"Backend for `call-graph' to search with."
118-
:type '(choice (const :tag "Global")
119-
(const :tag "Git"))
118+
:type '(choice (const :tag "Global" global)
119+
(const :tag "Git" git))
120120
:risky t
121121
:group 'call-graph)
122122

@@ -593,7 +593,7 @@ e.g: class::method(arg1, arg2) => class::method."
593593

594594
;; callers not found.
595595
(unless callers
596-
(seq-doseq (reference (if (and call-graph-search-backend (equal call-graph-search-backend "Global"))
596+
(seq-doseq (reference (if (and call-graph-search-backend (equal call-graph-search-backend 'global))
597597
(call-graph--global-find-references short-func)
598598
(call-graph--git-find-references short-func (call-graph--root-location call-graph))))
599599
(when-let* ((caller-info
@@ -652,7 +652,7 @@ CALCULATE-DEPTH is used to calculate actual depth."
652652
(setq call-graph--default-hierarchy (hierarchy-new))
653653
(unless call-graph-path-to-git-repo
654654
(setq call-graph-path-to-git-repo
655-
(shell-command-to-string "git rev-parse --show-toplevel")))
655+
(vc-root-dir)))
656656
(call-graph--search-callers call-graph func depth)
657657
(call-graph--build-hierarchy call-graph func depth)
658658
(call-graph--display-hierarchy)

0 commit comments

Comments
 (0)