summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Misc/vcs_info-examples2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 37f45f3b2..43129ecc2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2021-07-06 Suraj N. Kurapati <sunaku@riseup.net>
+
+ * 49128 (github #76): Misc/vcs_info-examples: optimize
+ +vi-git-untracked()
+
2021-06-28 Peter Stephenson <p.stephenson@samsung.com>
* 49102: Src/subst.c: Dynamic directory expansion failure is
diff --git a/Misc/vcs_info-examples b/Misc/vcs_info-examples
index edb0760d1..c2b02a2ac 100644
--- a/Misc/vcs_info-examples
+++ b/Misc/vcs_info-examples
@@ -160,7 +160,7 @@ zstyle ':vcs_info:git*+set-message:*' hooks git-untracked
+vi-git-untracked(){
if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == 'true' ]] && \
- git status --porcelain | grep '??' &> /dev/null ; then
+ git status --porcelain | grep -q '^?? ' 2> /dev/null ; then
# This will show the marker if there are any untracked files in repo.
# If instead you want to show the marker only if there are untracked
# files in $PWD, use: