Merge branch 'rs/check-ignore-multi'

"git check-ignore" with multiple paths got confused when one is a
file and the other is a directory, which has been fixed.

* rs/check-ignore-multi:
  check-ignore: fix mix of directories and other file types
This commit is contained in:
Junio C Hamano
2018-02-27 10:33:56 -08:00
2 changed files with 22 additions and 1 deletions

View File

@ -775,6 +775,26 @@ test_expect_success PIPE 'streaming support for --stdin' '
echo "$response" | grep "^:: two"
'
test_expect_success 'existing file and directory' '
test_when_finished "rm one" &&
test_when_finished "rmdir top-level-dir" &&
>one &&
mkdir top-level-dir &&
git check-ignore one top-level-dir >actual &&
grep one actual &&
grep top-level-dir actual
'
test_expect_success 'existing directory and file' '
test_when_finished "rm one" &&
test_when_finished "rmdir top-level-dir" &&
>one &&
mkdir top-level-dir &&
git check-ignore top-level-dir one >actual &&
grep one actual &&
grep top-level-dir actual
'
############################################################################
#
# test whitespace handling