branch: externals/vc-got
commit 623367586b18915b547b9f520c56c35ab024e8f3
Author: Timo Myyrä <timo.my...@bittivirhe.fi>
Commit: Omar Polo <o...@omarpolo.com>

    fix vc-got-mode-line to not refer past length of def
---
 vc-got.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/vc-got.el b/vc-got.el
index 068fcd15ad..4f46da3bbd 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -573,7 +573,8 @@ Got uses an implicit checkout model for every file."
   "Return the VC mode line string for FILE."
   (vc-got-with-worktree file
     (let ((def (vc-default-mode-line-string 'Got file)))
-      (concat (substring def 0 4) (vc-got--current-branch)))))
+      (concat (substring def 0 (min (length def) 4))
+              (vc-got--current-branch)))))
 
 
 ;; state-changing functions

Reply via email to