emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/org-contrib 3385f15a30 2/2: lisp/ol-git-link.el: org-gitba


From: ELPA Syncer
Subject: [nongnu] elpa/org-contrib 3385f15a30 2/2: lisp/ol-git-link.el: org-gitbare-open now appends "/.git" to path
Date: Sun, 10 Sep 2023 07:00:07 -0400 (EDT)

branch: elpa/org-contrib
commit 3385f15a303d40b4ffed563bc49b567462377751
Author: Rodrigo Morales <moralesrodrigo1100@gmail.com>
Commit: Bastien Guerry <bzg@gnu.org>

    lisp/ol-git-link.el: org-gitbare-open now appends "/.git" to path
    
    Previously, users needed to type the full path to the ".git" directory
    
    [[gitbare:~/source-code/emacs/.git::dbca2e797ab]]
    
    Now it is optional. That is, the following two links work.
    
    [[gitbare:~/source-code/emacs::dbca2e797ab]]
    [[gitbare:~/source-code/emacs/.git::dbca2e797ab]]
    
    TINYCHANGE
---
 lisp/ol-git-link.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lisp/ol-git-link.el b/lisp/ol-git-link.el
index a6e9043962..4be53ed8b6 100644
--- a/lisp/ol-git-link.el
+++ b/lisp/ol-git-link.el
@@ -75,7 +75,12 @@
 
 (defun org-gitbare-open (str _)
   (let* ((strlist (org-git-split-string str))
-         (gitdir (nth 0 strlist))
+         ;; If the provided path ends in /.git, use it. Otherwise,
+         ;; append "/.git".
+         (gitdir (let ((path (nth 0 strlist)))
+                   (if (string-suffix-p "/.git" path)
+                       (expand-file-name path)
+                     (expand-file-name ".git" path))))
          (object (nth 1 strlist)))
     (org-git-open-file-internal gitdir object)))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]