]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t1501-work-tree.sh
t1501: demonstrate NULL pointer access with invalid GIT_WORK_TREE
[thirdparty/git.git] / t / t1501-work-tree.sh
index cc5b870e5875bab8326393aea3a8d9f944210de6..046d9b7909f468b3e9c604641d3088e687da6db0 100755 (executable)
@@ -423,4 +423,12 @@ test_expect_success '$GIT_WORK_TREE overrides $GIT_DIR/common' '
        )
 '
 
+test_expect_failure 'error out gracefully on invalid $GIT_WORK_TREE' '
+       (
+               GIT_WORK_TREE=/.invalid/work/tree &&
+               export GIT_WORK_TREE &&
+               test_expect_code 128 git rev-parse
+       )
+'
+
 test_done