aboutsummaryrefslogtreecommitdiff
path: root/t/test-lib.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-02-13 11:42:07 -0800
committerJunio C Hamano <gitster@pobox.com>2012-02-13 11:42:07 -0800
commit8eb865ba8a24aad5380a23fc1e331aba2f7c5bbb (patch)
treec995cd1c09a8faed705a3fcf5f77a5b47a5533f2 /t/test-lib.sh
parenta78f5582fca15950eb43f93b246e3778d0ae84da (diff)
parentc2d17ba3db0d2b14daf04e69a8c5ec73b023c1fe (diff)
downloadgit-8eb865ba8a24aad5380a23fc1e331aba2f7c5bbb.tar.gz
git-8eb865ba8a24aad5380a23fc1e331aba2f7c5bbb.tar.xz
Merge branch 'jc/branch-desc-typoavoidance' into maint
* jc/branch-desc-typoavoidance: branch --edit-description: protect against mistyped branch name tests: add write_script helper function
Diffstat (limited to 't/test-lib.sh')
-rw-r--r--t/test-lib.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index a65dfc7ea..a089a1886 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -381,11 +381,20 @@ test_config () {
git config "$@"
}
+
test_config_global () {
test_when_finished "test_unconfig --global '$1'" &&
git config --global "$@"
}
+write_script () {
+ {
+ echo "#!${2-"$SHELL_PATH"}" &&
+ cat
+ } >"$1" &&
+ chmod +x "$1"
+}
+
# Use test_set_prereq to tell that a particular prerequisite is available.
# The prerequisite can later be checked for in two ways:
#