My Various Git Projects
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e7e07d5
)
t1501: demonstrate NULL pointer access with invalid GIT_WORK_TREE
author
Johannes Schindelin
<johannes.schindelin@gmx.de>
Wed, 8 Mar 2017 15:43:34 +0000
(16:43 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 8 Mar 2017 22:38:22 +0000
(14:38 -0800)
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>
t/t1501-work-tree.sh
patch
|
blob
|
history
diff --git
a/t/t1501-work-tree.sh
b/t/t1501-work-tree.sh
index
cc5b870
..
046d9b7
100755
(executable)
--- 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