diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2017-03-08 16:43:34 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-08 14:38:22 -0800 |
commit | aac3eaa6242d00d358a077aa740cf5051905a569 (patch) | |
tree | 10549d3a1dd30d8f40b5659a644a85ae93832cd7 /t/t1501-work-tree.sh | |
parent | e7e07d5a4fcc2a203d9873968ad3e6bd4d7419d7 (diff) | |
download | git-aac3eaa6242d00d358a077aa740cf5051905a569.tar.gz |
t1501: demonstrate NULL pointer access with invalid GIT_WORK_TREE
When GIT_WORK_TREE does not specify a valid path, we should error
out, instead of crashing.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1501-work-tree.sh')
-rwxr-xr-x | t/t1501-work-tree.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/t/t1501-work-tree.sh b/t/t1501-work-tree.sh index cc5b870e58..046d9b7909 100755 --- a/t/t1501-work-tree.sh +++ b/t/t1501-work-tree.sh @@ -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 |