diff options
| author | Jonas Bernoulli <jonas@bernoul.li> | 2022-01-20 17:11:00 +0100 |
|---|---|---|
| committer | Jonas Bernoulli <jonas@bernoul.li> | 2022-01-20 17:11:00 +0100 |
| commit | dad665e53ccffb41b5188550cf77a15ce27a1e3a (patch) | |
| tree | 942953a30a639d2fed268d6909171fc6b472a34c | |
| parent | 2a7812705f5cf4b864bb162576415863f4116285 (diff) | |
magit-rebase--get-state-lines: New function
| -rw-r--r-- | lisp/Makefile | 2 | ||||
| -rw-r--r-- | lisp/magit-sequence.el | 9 | ||||
| -rw-r--r-- | lisp/magit-stash.el | 10 |
3 files changed, 12 insertions, 9 deletions
diff --git a/lisp/Makefile b/lisp/Makefile index 3937afc..b0ef31f 100644 --- a/lisp/Makefile +++ b/lisp/Makefile @@ -53,7 +53,7 @@ magit-fetch.elc: magit.elc magit-pull.elc: magit.elc magit-remote.elc magit-push.elc: magit.elc magit-bisect.elc: magit.elc -magit-stash.elc: magit.elc magit-reflog.elc +magit-stash.elc: magit.elc magit-sequence.elc magit-reflog.elc magit-blame.elc: magit.elc magit-obsolete.elc: magit.elc magit-submodule.elc: magit.elc diff --git a/lisp/magit-sequence.el b/lisp/magit-sequence.el index ab6c4b1..bfc46eb 100644 --- a/lisp/magit-sequence.el +++ b/lisp/magit-sequence.el @@ -856,6 +856,15 @@ edit. With a prefix argument the old message is reused as-is." (defun magit--rebase-resume-command () (if (file-exists-p (magit-git-dir "rebase-recursive")) "rbr" "rebase")) +(defun magit-rebase--get-state-lines (file) + (and (magit-rebase-in-progress-p) + (magit-file-line + (magit-git-dir + (concat (if (file-directory-p (magit-git-dir "rebase-merge")) + "rebase-merge/" + "rebase-apply/") + file))))) + ;;; Sections (defun magit-insert-sequencer-sequence () diff --git a/lisp/magit-stash.el b/lisp/magit-stash.el index 2b80fc8..ecaf387 100644 --- a/lisp/magit-stash.el +++ b/lisp/magit-stash.el @@ -31,6 +31,7 @@ (require 'magit) (require 'magit-reflog) +(require 'magit-sequence) ;;; Options @@ -374,14 +375,7 @@ If optional REF is non-nil, show reflog for that instead. If optional HEADING is non-nil, use that as section heading instead of \"Stashes:\"." (let ((verified (magit-rev-verify ref)) - (autostash - (and (magit-rebase-in-progress-p) - (thread-first - (if (file-directory-p (magit-git-dir "rebase-merge")) - "rebase-merge/autostash" - "rebase-apply/autostash") - magit-git-dir - magit-file-line)))) + (autostash (magit-rebase--get-state-lines "autostash"))) (when (or autostash verified) (magit-insert-section (stashes ref) (magit-insert-heading heading) |
