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>
This commit is contained in:

committed by
Junio C Hamano

parent
e7e07d5a4f
commit
aac3eaa624
@ -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
|
test_done
|
||||||
|
Reference in New Issue
Block a user