Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] __git_commit_objects: do not use _guard, but a pattern



From: Daniel Hahler <git@xxxxxxxxxx>

With using `_guard` there like it's been done, the completion could not
be selected, probably because of the call to `_message` there.

This changes it to use only the logic/check from `_guard` that we want
here.
---
 Completion/Unix/Command/_git | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index a0ec343..fb9cae1 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -5657,7 +5657,7 @@ __git_commit_objects () {
   declare -a commits
 
   # Abort if the argument does not match a commit hash (including empty).
-  _guard '[[:xdigit:]](#c,40)' || return 1
+  [[ "$PREFIX$SUFFIX" == [[:xdigit:]](#c1,40) ]] || return 1
 
   # Note: the after-the-colon part must be unique across the entire array;
   # see workers/34768
-- 
2.4.0.dirty



Messages sorted by: Reverse Date, Date, Thread, Author