[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/detached 11dbd0a990: Improve metadata-git-branch
From: |
ELPA Syncer |
Subject: |
[elpa] externals/detached 11dbd0a990: Improve metadata-git-branch |
Date: |
Wed, 25 May 2022 13:57:26 -0400 (EDT) |
branch: externals/detached
commit 11dbd0a990f51c310bb119ae713b0ca7b10efe82
Author: Niklas Eklund <niklas.eklund@posteo.net>
Commit: Niklas Eklund <niklas.eklund@posteo.net>
Improve metadata-git-branch
Make sure the exit code is 0 in order to use the branch name returned
by the git command.
---
detached.el | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/detached.el b/detached.el
index 373efc52cf..77b5fa859d 100644
--- a/detached.el
+++ b/detached.el
@@ -1295,12 +1295,13 @@ If event is cased by an update to the `detached'
database, re-initialize
(defun detached--metadata-git-branch ()
"Return current git branch."
- (let ((args '("symbolic-ref" "HEAD" "--short")))
+ (let ((args '("symbolic-ref" "HEAD" "--short"))
+ (process-file-return-signal-string t))
(with-temp-buffer
- (apply #'process-file `("git" nil t nil ,@args))
- (unless (bobp)
- (goto-char (point-min))
- (buffer-substring-no-properties (point) (line-end-position))))))
+ (when (= 0 (apply #'process-file `("git" nil t nil ,@args)))
+ (unless (bobp)
+ (goto-char (point-min))
+ (buffer-substring-no-properties (point) (line-end-position)))))))
;;;;; UI
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/detached 11dbd0a990: Improve metadata-git-branch,
ELPA Syncer <=