]> gitweb.fluxo.info Git - scripts.git/commitdiff
Source git completion if needed
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 31 Mar 2014 14:43:26 +0000 (11:43 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 31 Mar 2014 14:43:26 +0000 (11:43 -0300)
prompt

diff --git a/prompt b/prompt
index 8247b1ae580f6c2c5f2e5fdd8fb63cf9a1900ab6..7669eb72b22e5d342d185729a4d1d997f9fc3152 100644 (file)
--- a/prompt
+++ b/prompt
@@ -42,4 +42,9 @@ function command_prompt() {
   PS2="${BOLD}>${OFF} "
 }
 
+# Older systems doesn't source git completion by default
+if ! type __git_ps1 &> /dev/null && [ -e "/etc/bash_completion.d/git" ]; then
+  source /etc/bash_completion.d/git
+fi
+
 PROMPT_COMMAND="command_prompt"