branch: scratch/gited commit d34b05ff26506db84a1120f917ada6d152fb7458 Author: Tino Calancha <tino.calan...@gmail.com> Commit: Tino Calancha <tino.calan...@gmail.com>
* gited.el (gited-goto-branch): Check first that BRANCH is shown. --- packages/gited/gited.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/gited/gited.el b/packages/gited/gited.el index 55ba8bd..4b67b88 100644 --- a/packages/gited/gited.el +++ b/packages/gited/gited.el @@ -10,9 +10,9 @@ ;; Compatibility: GNU Emacs: 24.4 ;; Version: 0.2.0 ;; Package-Requires: ((emacs "24.4") (cl-lib "0.5")) -;; Last-Updated: Thu Jun 08 14:26:38 JST 2017 +;; Last-Updated: Thu Jun 08 19:08:23 JST 2017 ;; By: calancha -;; Update #: 650 +;; Update #: 651 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; @@ -2361,10 +2361,11 @@ Return buffer position on success, else nil." (list (completing-read "Jump to branch: " (gited-listed-branches) nil t nil nil cur-branch)))) - (let ((row (cl-position branch (gited-listed-branches) :test #'equal))) - (goto-char (point-min)) - (forward-line (if (overlays-at (point-min)) (1+ row) row)) - (gited--goto-column (1+ gited-branch-idx)))) + (when (gited-branch-exists-p branch) + (let ((row (cl-position branch (gited-listed-branches) :test #'equal))) + (goto-char (point-min)) + (forward-line (if (overlays-at (point-min)) (1+ row) row)) + (gited--goto-column (1+ gited-branch-idx))))) (defun gited-next-marked-branch (arg &optional wrap opoint) "Move to the next ARG marked branch.