Fix git status breaking in brand new repos with nil checks
This commit is contained in:
parent
f8d42c6828
commit
1502872174
7
p11k.el
7
p11k.el
@ -236,15 +236,18 @@ Use 'window-width' to calculate the total final width."
|
||||
(--> "git status -s"
|
||||
(shell-command-to-string it)
|
||||
(split-string it "\n" 'omit-nulls search-whitespace-regexp)
|
||||
(if it
|
||||
(--map (let ((parts (split-string it)))
|
||||
(cons (car parts) (cadr parts)))
|
||||
it)))
|
||||
it) nil)))
|
||||
(branch (--> "git branch"
|
||||
(shell-command-to-string it)
|
||||
(split-string it "\n" 'omit-nulls search-whitespace-regexp)
|
||||
(if it (progn
|
||||
(--filter (string-match-p (rx bol "* " (+ word)) it) it)
|
||||
(split-string (car it))
|
||||
(cadr it)))
|
||||
(cadr it))
|
||||
"")))
|
||||
(modcount (--> status-alist
|
||||
(--map (car it) it)
|
||||
(--count (string-match-p "M" it) it)
|
||||
|
Loading…
Reference in New Issue
Block a user