Replace `file-exists-p' with `file-{directory,regular}-p' to ensure:
- ".git/rebase-merge" is a (symlink to a) directory.
- ".git/rebase-apply/onto" is a (symlink to a) file.

Signed-off-by: Pieter Praet <[email protected]>
---
 magit.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/magit.el b/magit.el
index 5698f12..f1a1d31 100644
--- a/magit.el
+++ b/magit.el
@@ -4897,7 +4897,7 @@ (defun magit-rebase-info ()
   (let ((m (magit-git-dir "rebase-merge"))
         (a (magit-git-dir "rebase-apply")))
     (cond
-     ((file-exists-p m) ; interactive
+     ((file-directory-p m) ; interactive
       (list
        (magit-name-rev (magit-file-line  (expand-file-name "onto" m)))
        (length         (magit-file-lines (expand-file-name "done" m)))
@@ -4907,7 +4907,7 @@ (defun magit-rebase-info ()
          (cl-loop while (re-search-forward "^[^#\n]" nil t) count t))
        (magit-file-line (expand-file-name "stopped-sha" m))))
 
-     ((file-exists-p (expand-file-name "onto" a)) ; non-interactive
+     ((file-regular-p (expand-file-name "onto" a)) ; non-interactive
       (list
        (magit-name-rev       (magit-file-line (expand-file-name "onto" a)))
        (1- (string-to-number (magit-file-line (expand-file-name "next" a))))
-- 
1.7.11.1

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"magit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to