2020-03-03 04:05:06 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
test_description='diagnosing out-of-scope pathspec'
|
|
|
|
|
2021-10-30 22:24:13 +00:00
|
|
|
TEST_PASSES_SANITIZE_LEAK=true
|
2020-03-03 04:05:06 +00:00
|
|
|
. ./test-lib.sh
|
|
|
|
|
|
|
|
test_expect_success 'setup a bare and non-bare repository' '
|
|
|
|
test_commit file1 &&
|
|
|
|
git clone --bare . bare
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'log and ls-files in a bare repository' '
|
|
|
|
(
|
|
|
|
cd bare &&
|
|
|
|
test_must_fail git log -- .. >out 2>err &&
|
|
|
|
test_must_be_empty out &&
|
2023-10-31 05:23:30 +00:00
|
|
|
test_grep "outside repository" err &&
|
2020-03-03 04:05:06 +00:00
|
|
|
|
|
|
|
test_must_fail git ls-files -- .. >out 2>err &&
|
|
|
|
test_must_be_empty out &&
|
2023-10-31 05:23:30 +00:00
|
|
|
test_grep "outside repository" err
|
2020-03-03 04:05:06 +00:00
|
|
|
)
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'log and ls-files in .git directory' '
|
|
|
|
(
|
|
|
|
cd .git &&
|
|
|
|
test_must_fail git log -- .. >out 2>err &&
|
|
|
|
test_must_be_empty out &&
|
2023-10-31 05:23:30 +00:00
|
|
|
test_grep "outside repository" err &&
|
2020-03-03 04:05:06 +00:00
|
|
|
|
|
|
|
test_must_fail git ls-files -- .. >out 2>err &&
|
|
|
|
test_must_be_empty out &&
|
2023-10-31 05:23:30 +00:00
|
|
|
test_grep "outside repository" err
|
2020-03-03 04:05:06 +00:00
|
|
|
)
|
|
|
|
'
|
|
|
|
|
|
|
|
test_done
|