From f68239fba2645b82e5e7d99d5c740f4a8d02535d Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 13 Sep 2016 16:43:15 +1200 Subject: Version check for bashdefault in Git completion --- bash/bash_completion.d/git.bash | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'bash') diff --git a/bash/bash_completion.d/git.bash b/bash/bash_completion.d/git.bash index 5f4290b8..bde515ee 100644 --- a/bash/bash_completion.d/git.bash +++ b/bash/bash_completion.d/git.bash @@ -222,5 +222,10 @@ _git() { esac } -# Defaulting to directory/file completion is important in Git's case -complete -F _git -o bashdefault -o default git +# Defaulting to directory/file completion is important in Git's case; +# bashdefault requires Bash >=3.0 +if ((BASH_VERSINFO[0] >= 3)) ; then + complete -F _git -o bashdefault -o default git +else + complete -F _git -o default git +fi -- cgit v1.2.3