aboutsummaryrefslogtreecommitdiff
path: root/t/lib-bash.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-06-28 15:21:00 -0700
committerJunio C Hamano <gitster@pobox.com>2012-06-28 15:21:00 -0700
commite90020cdb3273af3b0c7915c0aacf16b19bbf994 (patch)
tree7877275ba126cfe2cea62bfb9f6ec33c3680bf14 /t/lib-bash.sh
parenta3fbb2350dcd2d843d1d90b663521222aceb25fe (diff)
parentb7be4366ea9af9a6947a8be0ebe6a63ff5259b6a (diff)
downloadgit-e90020cdb3273af3b0c7915c0aacf16b19bbf994.tar.gz
git-e90020cdb3273af3b0c7915c0aacf16b19bbf994.tar.xz
Merge branch 'fc/git-prompt-script'
Split a rather heavy-ish "git completion" script out to create a separate "git prompting" script, to help lazy-autoloading of the completion part while making prompting part always available.
Diffstat (limited to 't/lib-bash.sh')
-rw-r--r--t/lib-bash.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/lib-bash.sh b/t/lib-bash.sh
new file mode 100644
index 000000000..11397f747
--- /dev/null
+++ b/t/lib-bash.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+#
+# Ensures that tests are run under Bash; primarily intended for running tests
+# of the completion script.
+
+if test -n "$BASH" && test -z "$POSIXLY_CORRECT"; then
+ # we are in full-on bash mode
+ true
+elif type bash >/dev/null 2>&1; then
+ # execute in full-on bash mode
+ unset POSIXLY_CORRECT
+ exec bash "$0" "$@"
+else
+ echo '1..0 #SKIP skipping bash completion tests; bash not available'
+ exit 0
+fi
+
+. ./test-lib.sh