From 13d6c94cfb4783a8b92dd26c7a9b3de134d8c018 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 26 Jul 2021 13:57:31 -0400 Subject: [PATCH] bash-completion: fallback to default completion If we can't provide any completions, then fallback to the standard bash & readline ones. This allows completion based on the user's settings (e.g. local paths) to kick in. Bug: https://crbug.com/gerrit/14797 Test: `repo rebase ./src/` works in a CrOS checkout Change-Id: Iced343c4fc6fd3a932aab99875c1346687d187b6 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/312902 Reviewed-by: Xin Li Tested-by: Mike Frysinger --- completion.bash | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/completion.bash b/completion.bash index 0b52d29c..3c1fd683 100644 --- a/completion.bash +++ b/completion.bash @@ -118,4 +118,6 @@ __complete_repo() { return 0 } -complete -F __complete_repo repo +# Fallback to the default complete methods if we aren't able to provide anything +# useful. This will allow e.g. local paths to be used when it makes sense. +complete -F __complete_repo -o bashdefault -o default repo