summaryrefslogtreecommitdiff
path: root/t/chainlint/function.test
diff options
context:
space:
mode:
Diffstat (limited to 't/chainlint/function.test')
-rw-r--r--t/chainlint/function.test15
1 files changed, 15 insertions, 0 deletions
diff --git a/t/chainlint/function.test b/t/chainlint/function.test
new file mode 100644
index 0000000000..763fcf3f87
--- /dev/null
+++ b/t/chainlint/function.test
@@ -0,0 +1,15 @@
+test_expect_success 'function' '
+# LINT: "()" in function definition not mistaken for subshell
+sha1_file() {
+ echo "$*" | sed "s#..#.git/objects/&/#"
+} &&
+
+# LINT: broken &&-chain in function and after function
+remove_object() {
+ file=$(sha1_file "$*") &&
+ test -e "$file"
+ rm -f "$file"
+}
+
+sha1_file arg && remove_object arg
+'