mirror of
https://github.com/git/git
synced 2024-08-28 12:09:19 +00:00
![Johannes Schindelin](/assets/img/avatar_default.png)
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)
70 lines
1.2 KiB
Bash
Executable file
70 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
|