diff options
| author | Benjamin Lindqvist <benjamin.lindqvist@endian.se> | 2019-07-11 07:23:38 +0200 |
|---|---|---|
| committer | Benjamin Lindqvist <benjamin.lindqvist@endian.se> | 2019-08-22 15:52:39 +0200 |
| commit | b37041ae37104a3d7d85e4c14de490032cdcd666 (patch) | |
| tree | 43a3496f1e1201ee929d5782f8c7446f257e66d1 | |
| parent | 7821c08e4fbfa9a42d9546c681f4b79d3cb83d5c (diff) | |
Enable getting git branch w/o magit
Force push fix for removing newline
| -rw-r--r-- | feebleline.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/feebleline.el b/feebleline.el index eea9a09..9e16c2e 100644 --- a/feebleline.el +++ b/feebleline.el @@ -63,8 +63,12 @@ (defun feebleline-git-branch () "Return current git branch, unless file is remote." (if (and (buffer-file-name) (file-remote-p (buffer-file-name))) - "-" - (magit-get-current-branch))) + "" + (let ((branch (shell-command-to-string + "git rev-parse --symbolic-full-name --abbrev-ref HEAD"))) + (string-trim (replace-regexp-in-string + "^HEAD" "(detached HEAD)" + branch))))) (defcustom feebleline-msg-functions '((feebleline-line-number :post "" :fmt "%5s") |
