[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Fix vc-working-revision return nil when default-directory is not
From: |
Ilya Ostapyshyn |
Subject: |
[PATCH] Fix vc-working-revision return nil when default-directory is not inside repo |
Date: |
Sun, 17 May 2020 14:16:01 +0300 |
Hello emacs-devel,
"vc-git-mode-line-string" (which is called automatically) failed
occasionally with an error message (wrong-type-argument arrayp nil) when
the default-directory is outside the repository.
I hunted the error down to "vc-working-revision" function, which
returned nil under those particular circumstances. The returned value
(nil) was then passed to as an argument to "substring", causing a type
error.
If there are better ways to resolve this issue, I would be very happy to
discover them. Nonetheless I've seen such approach of "let"-ing the
default-directory variable a few times across the emacs source code
tree.
Would doing this on a lower level, for example in "vc-call-backend" be a
better approach?
0001-lisp-vc-vc-hooks.el-Set-default-directory-to-be-insi.patch
Description: PATCH
- [PATCH] Fix vc-working-revision return nil when default-directory is not inside repo,
Ilya Ostapyshyn <=