1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-10-29 21:37:53 +01:00
git/t/t3002-ls-files-dashpath.sh
Johannes Schindelin 5bd74506cd Get rid of the dependency to GNU diff in the tests
Now that "git diff" handles stdin and relative paths outside the
working tree correctly, we can convert all instances of "diff -u"
to "git diff".

This commit is really the result of

$ perl -pi.bak -e 's/diff -u/git diff/' $(git grep -l "diff -u" t/)

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>

(cherry picked from commit c699a40d68215c7e44a5b26117a35c8a56fbd387)
2007-03-04 00:24:15 -08:00

69 lines
1.2 KiB
Bash
Executable file

#!/bin/sh
#
# Copyright (c) 2005 Junio C Hamano
#
test_description='git-ls-files test (-- to terminate the path list).
This test runs git-ls-files --others with the following on the
filesystem.
path0 - a file
-foo - a file with a funny name.
-- - another file with a funny name.
'
. ./test-lib.sh
test_expect_success \
setup \
'echo frotz >path0 &&
echo frotz >./-foo &&
echo frotz >./--'
test_expect_success \
'git-ls-files without path restriction.' \
'git-ls-files --others >output &&
git diff output - <<EOF
--
-foo
output
path0
EOF
'
test_expect_success \
'git-ls-files with path restriction.' \
'git-ls-files --others path0 >output &&
git diff output - <<EOF
path0
EOF
'
test_expect_success \
'git-ls-files with path restriction with --.' \
'git-ls-files --others -- path0 >output &&
git diff output - <<EOF
path0
EOF
'
test_expect_success \
'git-ls-files with path restriction with -- --.' \
'git-ls-files --others -- -- >output &&
git diff output - <<EOF
--
EOF
'
test_expect_success \
'git-ls-files with no path restriction.' \
'git-ls-files --others -- >output &&
git diff output - <<EOF
--
-foo
output
path0
EOF
'
test_done