summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/km-magit.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/km-magit.el b/lisp/km-magit.el
index c8b855a..38fe1cb 100644
--- a/lisp/km-magit.el
+++ b/lisp/km-magit.el
@@ -73,10 +73,14 @@ project, or 3) an commit object for the hash at point doesn't
exist in the current project."
(interactive "P")
(if (save-excursion (skip-chars-backward "[[:xdigit:]]")
- (looking-at (rx word-boundary
- (repeat 4 40 xdigit)
+ ;; Handle git-describe's *-g<hexsha>.
+ (when (and (equal (char-after (- (point) 1)) ?g)
+ (equal (char-after (- (point) 2)) ?-))
+ (forward-char -2))
+ (looking-at (rx (or word-boundary "-g")
+ (group (repeat 4 40 xdigit))
word-boundary)))
- (let* ((hash (match-string-no-properties 0))
+ (let* ((hash (match-string-no-properties 1))
(project
(and (or choose-project
(not (projectile-project-p))