diff options
| author | Michael Albinus | 2018-11-15 13:55:23 +0100 |
|---|---|---|
| committer | Michael Albinus | 2018-11-15 13:55:23 +0100 |
| commit | ce915653df74166fe6eb5783d57619b73cd74681 (patch) | |
| tree | 4c5a5d032802e3435d629b9211480bb114399f7f | |
| parent | 35a88c809e9eb5a32dd8d7f0dae960021f4cd707 (diff) | |
| download | emacs-ce915653df74166fe6eb5783d57619b73cd74681.tar.gz emacs-ce915653df74166fe6eb5783d57619b73cd74681.zip | |
Fix Bug#33394
* lisp/net/trampver.el (tramp-repository-branch)
(tramp-repository-version): Handle out-of-tree builds. (Bug#33394)
| -rw-r--r-- | lisp/net/trampver.el | 22 |
1 files 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 @@ | |||
| 40 | 40 | ||
| 41 | (defconst tramp-repository-branch | 41 | (defconst tramp-repository-branch |
| 42 | (ignore-errors | 42 | (ignore-errors |
| 43 | ;; Suppress message from `emacs-repository-get-branch'. | 43 | ;; Suppress message from `emacs-repository-get-branch'. We must |
| 44 | (let ((inhibit-message t)) | 44 | ;; also handle out-of-tree builds. |
| 45 | (let ((inhibit-message t) | ||
| 46 | (dir (or (locate-dominating-file (locate-library "tramp") ".git") | ||
| 47 | source-directory))) | ||
| 45 | ;; `emacs-repository-get-branch' has been introduced with Emacs 27.1. | 48 | ;; `emacs-repository-get-branch' has been introduced with Emacs 27.1. |
| 46 | (with-no-warnings | 49 | (with-no-warnings |
| 47 | (emacs-repository-get-branch | 50 | (and (stringp dir) (file-directory-p dir) |
| 48 | (locate-dominating-file (locate-library "tramp") ".git"))))) | 51 | (emacs-repository-get-branch dir))))) |
| 49 | "The repository branch of the Tramp sources.") | 52 | "The repository branch of the Tramp sources.") |
| 50 | 53 | ||
| 51 | (defconst tramp-repository-version | 54 | (defconst tramp-repository-version |
| 52 | (ignore-errors | 55 | (ignore-errors |
| 53 | ;; Suppress message from `emacs-repository-get-version'. | 56 | ;; Suppress message from `emacs-repository-get-version'. We must |
| 54 | (let ((inhibit-message t)) | 57 | ;; also handle out-of-tree builds. |
| 55 | (emacs-repository-get-version | 58 | (let ((inhibit-message t) |
| 56 | (locate-dominating-file (locate-library "tramp") ".git")))) | 59 | (dir (or (locate-dominating-file (locate-library "tramp") ".git") |
| 60 | source-directory))) | ||
| 61 | (and (stringp dir) (file-directory-p dir) | ||
| 62 | (emacs-repository-get-version dir)))) | ||
| 57 | "The repository revision of the Tramp sources.") | 63 | "The repository revision of the Tramp sources.") |
| 58 | 64 | ||
| 59 | ;; Check for Emacs version. | 65 | ;; Check for Emacs version. |