From: Juri Linkov Date: Wed, 10 Nov 2021 18:41:19 +0000 (+0200) Subject: * lisp/vc/vc-git.el (vc-git-mergebase): More meaningful error message. X-Git-Tag: emacs-28.0.90~87 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2963de6540a1dc57399eaf530d8e12c794137a84;p=emacs.git * lisp/vc/vc-git.el (vc-git-mergebase): More meaningful error message. Display a readable error message instead of signaling an error on nil value. --- diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 3f89fad2351..2d35061b269 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1256,7 +1256,10 @@ log entries." (defun vc-git-mergebase (rev1 &optional rev2) (unless rev2 (setq rev2 "HEAD")) - (string-trim-right (vc-git--run-command-string nil "merge-base" rev1 rev2))) + (let ((base (vc-git--run-command-string nil "merge-base" rev1 rev2))) + (if base + (string-trim-right base) + (error "No common ancestor for merge base")))) (defvar log-view-message-re) (defvar log-view-file-re)