aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--setup.c2
-rwxr-xr-xt/t3101-ls-tree-dirname.sh2
-rwxr-xr-xt/t7010-setup.sh7
3 files changed, 7 insertions, 4 deletions
diff --git a/setup.c b/setup.c
index 89c81e54e..41e298b8f 100644
--- a/setup.c
+++ b/setup.c
@@ -202,6 +202,8 @@ const char **get_pathspec(const char *prefix, const char **pathspec)
const char *p = prefix_path(prefix, prefixlen, *src);
if (p)
*(dst++) = p;
+ else
+ exit(128); /* error message already given */
src++;
}
*dst = NULL;
diff --git a/t/t3101-ls-tree-dirname.sh b/t/t3101-ls-tree-dirname.sh
index 39fe2676d..70f9ce9d5 100755
--- a/t/t3101-ls-tree-dirname.sh
+++ b/t/t3101-ls-tree-dirname.sh
@@ -120,7 +120,7 @@ EOF
# having 1.txt and path3
test_expect_success \
'ls-tree filter odd names' \
- 'git ls-tree $tree 1.txt /1.txt //1.txt path3/1.txt /path3/1.txt //path3//1.txt path3 /path3/ path3// >current &&
+ 'git ls-tree $tree 1.txt ./1.txt .//1.txt path3/1.txt path3/./1.txt path3 path3// >current &&
cat >expected <<\EOF &&
100644 blob X 1.txt
100644 blob X path3/1.txt
diff --git a/t/t7010-setup.sh b/t/t7010-setup.sh
index e809e0e2c..bc8ab6a61 100755
--- a/t/t7010-setup.sh
+++ b/t/t7010-setup.sh
@@ -142,15 +142,16 @@ test_expect_success 'setup deeper work tree' '
test_expect_success 'add a directory outside the work tree' '(
cd tester &&
d1="$(cd .. ; pwd)" &&
- git add "$d1"
+ test_must_fail git add "$d1"
)'
+
test_expect_success 'add a file outside the work tree, nasty case 1' '(
cd tester &&
f="$(pwd)x" &&
echo "$f" &&
touch "$f" &&
- git add "$f"
+ test_must_fail git add "$f"
)'
test_expect_success 'add a file outside the work tree, nasty case 2' '(
@@ -158,7 +159,7 @@ test_expect_success 'add a file outside the work tree, nasty case 2' '(
f="$(pwd | sed "s/.$//")x" &&
echo "$f" &&
touch "$f" &&
- git add "$f"
+ test_must_fail git add "$f"
)'
test_done