Skip to content

Commit e7b2dfe

Browse files
committed
Fix for relative paths of magit files
Resolve changed files from git with absolute paths, to pass to file tracing function.
1 parent 4261e5b commit e7b2dfe

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/el/sayid-magit.el

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,25 @@
2727
"Trace namespace in FILE-NAMES."
2828
(mapcar (lambda (file-name)
2929
(with-current-buffer (find-file-noselect
30-
(expand-file-name file-name))
30+
file-name)
3131
(nrepl-send-sync-request (list "op" "sayid-trace-ns-in-file"
3232
"file" (buffer-file-name))
3333
(cider-current-connection))))
3434
file-names)
3535
(sayid-show-traced))
3636

37+
(defun sayid-magit--changed-files ()
38+
"docstring"
39+
(mapcar
40+
(lambda (file)
41+
(expand-file-name file (locate-dominating-file (buffer-file-name) ".git")))
42+
(magit-changed-files (magit-read-starting-point "Sayid trace" nil "HEAD"))))
43+
3744
;;;###autoload
3845
(defun sayid-magit-trace-changed-ns ()
3946
"Trace the changed namespaces in a git commit."
4047
(interactive)
41-
(sayid--trace-ns-in-files
42-
(magit-changed-files (magit-read-starting-point "Sayid trace" nil "HEAD"))))
48+
(sayid--trace-ns-in-files (sayid-magit--changed-files)))
4349

4450
(provide 'sayid-magit)
4551

0 commit comments

Comments
 (0)