зеркало из https://github.com/microsoft/git.git
completion tests: check __gitdir()'s output in the error cases
The __gitdir() helper function shouldn't output anything if not in a git repository. The relevant tests only checked its error code, so extend them to ensure that there's no output. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Родитель
f611440811
Коммит
8f0fa85d4d
|
@ -215,8 +215,9 @@ test_expect_success '__gitdir - non-existing $GIT_DIR' '
|
||||||
(
|
(
|
||||||
GIT_DIR="$ROOT/non-existing" &&
|
GIT_DIR="$ROOT/non-existing" &&
|
||||||
export GIT_DIR &&
|
export GIT_DIR &&
|
||||||
test_must_fail __gitdir
|
test_must_fail __gitdir >"$actual"
|
||||||
)
|
) &&
|
||||||
|
test_must_be_empty "$actual"
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success '__gitdir - gitfile in cwd' '
|
test_expect_success '__gitdir - gitfile in cwd' '
|
||||||
|
@ -255,7 +256,8 @@ test_expect_success SYMLINKS '__gitdir - resulting path avoids symlinks' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success '__gitdir - not a git repository' '
|
test_expect_success '__gitdir - not a git repository' '
|
||||||
nongit test_must_fail __gitdir
|
nongit test_must_fail __gitdir >"$actual" &&
|
||||||
|
test_must_be_empty "$actual"
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success '__gitcomp - trailing space - options' '
|
test_expect_success '__gitcomp - trailing space - options' '
|
||||||
|
|
Загрузка…
Ссылка в новой задаче