branch: elpa/git-commit commit 6cd8bcaf188aaa3bf5fd5fddaf47e63193f150d3 Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
Use string-prefix-p and string-suffix-p --- lisp/magit-base.el | 2 +- lisp/magit-commit.el | 2 +- lisp/magit-diff.el | 2 +- lisp/magit-git.el | 6 +++--- lisp/magit-sequence.el | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lisp/magit-base.el b/lisp/magit-base.el index e14bfe546c..6add5a0564 100644 --- a/lisp/magit-base.el +++ b/lisp/magit-base.el @@ -1181,7 +1181,7 @@ or (last of all) the value of EXP." ;;;###autoload (defun org-man-export--magit-gitman (fn link description format) (if (and (eq format 'texinfo) - (string-match-p "\\`git" link)) + (string-prefix-p "git" link)) (replace-regexp-in-string "%s" link " @ifinfo @ref{%s,,,gitman,}. diff --git a/lisp/magit-commit.el b/lisp/magit-commit.el index 8eabac5a55..581f5bbf88 100644 --- a/lisp/magit-commit.el +++ b/lisp/magit-commit.el @@ -370,7 +370,7 @@ depending on the value of option `magit-commit-squash-confirm'." (magit-call-git "commit" "--no-gpg-sign" (-remove-first - (apply-partially #'string-match-p "\\`--gpg-sign=") + (apply-partially #'string-prefix-p "--gpg-sign=") args))) (magit-run-git-with-editor "commit" args)) t) ; The commit was created; used by below lambda. diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el index ff0a5bce6e..76d3cc6175 100644 --- a/lisp/magit-diff.el +++ b/lisp/magit-diff.el @@ -2331,7 +2331,7 @@ section or a child thereof." (string-prefix-p "a/" orig) (string-prefix-p "b/" file)) (and (derived-mode-p 'magit-log-mode) - (--first (string-match-p "\\`-L" it) + (--first (string-prefix-p "-L" it) magit-buffer-log-args))) (setq file (substring file 2)) (when orig diff --git a/lisp/magit-git.el b/lisp/magit-git.el index 958bddfd60..cc690ab267 100644 --- a/lisp/magit-git.el +++ b/lisp/magit-git.el @@ -1927,17 +1927,17 @@ SORTBY is a key or list of keys to pass to the `--sort' flag of (--map (substring it 6) (magit-list-refnames "refs/notes"))) (defun magit-remote-list-tags (remote) - (--keep (and (not (string-match-p "\\^{}$" it)) + (--keep (and (not (string-suffix-p "^{}" it)) (substring it 51)) (magit-git-lines "ls-remote" "--tags" remote))) (defun magit-remote-list-branches (remote) - (--keep (and (not (string-match-p "\\^{}$" it)) + (--keep (and (not (string-suffix-p "^{}" it)) (substring it 52)) (magit-git-lines "ls-remote" "--heads" remote))) (defun magit-remote-list-refs (remote) - (--keep (and (not (string-match-p "\\^{}$" it)) + (--keep (and (not (string-suffix-p "^{}" it)) (substring it 41)) (magit-git-lines "ls-remote" remote))) diff --git a/lisp/magit-sequence.el b/lisp/magit-sequence.el index 91e1d2df6d..7896d42f21 100644 --- a/lisp/magit-sequence.el +++ b/lisp/magit-sequence.el @@ -361,7 +361,7 @@ the process manually." ;; And CHERRY_PICK_HEAD does not exist when a conflict happens ;; while picking a series of commits with --no-commit. (when-let ((line (magit-file-line (magit-git-dir "sequencer/todo")))) - (string-match-p "^pick" line)))) + (string-prefix-p "pick" line)))) ;;; Revert @@ -417,7 +417,7 @@ without prompting." ;; And REVERT_HEAD does not exist when a conflict happens while ;; reverting a series of commits with --no-commit. (when-let ((line (magit-file-line (magit-git-dir "sequencer/todo")))) - (string-match-p "^revert" line)))) + (string-prefix-p "revert" line)))) ;;; Patch