From ce915653df74166fe6eb5783d57619b73cd74681 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Thu, 15 Nov 2018 13:55:23 +0100 Subject: [PATCH] Fix Bug#33394 * lisp/net/trampver.el (tramp-repository-branch) (tramp-repository-version): Handle out-of-tree builds. (Bug#33394) --- lisp/net/trampver.el | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index f93e5380849..d9b152e2bf6 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el @@ -40,20 +40,26 @@ (defconst tramp-repository-branch (ignore-errors - ;; Suppress message from `emacs-repository-get-branch'. - (let ((inhibit-message t)) + ;; Suppress message from `emacs-repository-get-branch'. We must + ;; also handle out-of-tree builds. + (let ((inhibit-message t) + (dir (or (locate-dominating-file (locate-library "tramp") ".git") + source-directory))) ;; `emacs-repository-get-branch' has been introduced with Emacs 27.1. (with-no-warnings - (emacs-repository-get-branch - (locate-dominating-file (locate-library "tramp") ".git"))))) + (and (stringp dir) (file-directory-p dir) + (emacs-repository-get-branch dir))))) "The repository branch of the Tramp sources.") (defconst tramp-repository-version (ignore-errors - ;; Suppress message from `emacs-repository-get-version'. - (let ((inhibit-message t)) - (emacs-repository-get-version - (locate-dominating-file (locate-library "tramp") ".git")))) + ;; Suppress message from `emacs-repository-get-version'. We must + ;; also handle out-of-tree builds. + (let ((inhibit-message t) + (dir (or (locate-dominating-file (locate-library "tramp") ".git") + source-directory))) + (and (stringp dir) (file-directory-p dir) + (emacs-repository-get-version dir)))) "The repository revision of the Tramp sources.") ;; Check for Emacs version. -- 2.39.5