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

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

[nongnu] elpa/git-commit 197f51f 5/8: magit-list-worktree: Make sure all


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit 197f51f 5/8: magit-list-worktree: Make sure all paths are worktrees
Date: Tue, 12 Oct 2021 14:57:48 -0400 (EDT)

branch: elpa/git-commit
commit 197f51fd5b1d43dfc7672bd6b51cd0e3311797d2
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    magit-list-worktree: Make sure all paths are worktrees
    
    If the git directory is separate from the main worktree,
    then "git worktree" returns the git directory instead of
    the worktree, which isn't what it is supposed to do and
    now what we want.
---
 Documentation/RelNotes/3.4.0.org | 4 ++++
 lisp/magit-git.el                | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/Documentation/RelNotes/3.4.0.org b/Documentation/RelNotes/3.4.0.org
index 36ee456..5543fe9 100644
--- a/Documentation/RelNotes/3.4.0.org
+++ b/Documentation/RelNotes/3.4.0.org
@@ -9,3 +9,7 @@
 
 - Automatic saving of file-visiting buffers was broken inside remote
   repositories that are accessed using Tramp.  #4292
+
+- Worktree commands and listing worktrees in the status buffer were
+  broken inside remote repositories that are accessed using Tramp.
+  #4326
diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index c399b05..6056e94 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -1833,6 +1833,11 @@ PATH has to be relative to the super-repository."
              (let ((path (substring line 9)))
                (when remote
                  (setq path (concat remote path)))
+               ;; If the git directory is separate from the main
+               ;; worktree, then "git worktree" returns the git
+               ;; directory instead of the worktree, which isn't
+               ;; what it is supposed to do and now what we want.
+               (setq path (magit-toplevel path))
                (setq worktree (list path nil nil nil))
                (push worktree worktrees)))
             ((string-equal line "bare")



reply via email to

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