Skip to content

Commit

Permalink
tests: do not borrow from COPYING and README from the real source
Browse files Browse the repository at this point in the history
These two files have been modified since the tests started using
as test input, making the exact object names they expect to be
different from what actually happens in the trash repository they
use to run tests.

Instead, take a snapshot of these two files and keep them in
t/diff-lib/ so that we can update the real ones without having to
worry about breaking tests.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Feb 15, 2015
1 parent bb8db1b commit 459b8d2
Show file tree
Hide file tree
Showing 7 changed files with 433 additions and 26 deletions.
361 changes: 361 additions & 0 deletions t/diff-lib/COPYING

Large diffs are not rendered by default.

46 changes: 46 additions & 0 deletions t/diff-lib/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
////////////////////////////////////////////////////////////////

GIT - the stupid content tracker

////////////////////////////////////////////////////////////////

"git" can mean anything, depending on your mood.

- random three-letter combination that is pronounceable, and not
actually used by any common UNIX command. The fact that it is a
mispronunciation of "get" may or may not be relevant.
- stupid. contemptible and despicable. simple. Take your pick from the
dictionary of slang.
- "global information tracker": you're in a good mood, and it actually
works for you. Angels sing, and a light suddenly fills the room.
- "goddamn idiotic truckload of sh*t": when it breaks

Git is a fast, scalable, distributed revision control system with an
unusually rich command set that provides both high-level operations
and full access to internals.

Git is an Open Source project covered by the GNU General Public License.
It was originally written by Linus Torvalds with help of a group of
hackers around the net. It is currently maintained by Junio C Hamano.

Please read the file INSTALL for installation instructions.
See Documentation/tutorial.txt to get started, then see
Documentation/everyday.txt for a useful minimum set of commands,
and "man git-commandname" for documentation of each command.
CVS users may also want to read Documentation/cvs-migration.txt.

Many Git online resources are accessible from http://git.or.cz/
including full documentation and Git related tools.

The user discussion and development of Git take place on the Git
mailing list -- everyone is welcome to post bug reports, feature
requests, comments and patches to git@vger.kernel.org. To subscribe
to the list, send an email with just "subscribe git" in the body to
majordomo@vger.kernel.org. The mailing list archives are available at
http://marc.theaimsgroup.com/?l=git and other archival sites.

The messages titled "A note from the maintainer", "What's in
git.git (stable)" and "What's cooking in git.git (topics)" and
the discussion following them on the mailing list give a good
reference for project status, development direction and
remaining tasks.
4 changes: 2 additions & 2 deletions t/t4003-diff-rename-1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test_description='More rename detection

test_expect_success \
'prepare reference tree' \
'cat "$TEST_DIRECTORY"/../COPYING >COPYING &&
'cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
echo frotz >rezrov &&
git update-index --add COPYING rezrov &&
tree=$(git write-tree) &&
Expand Down Expand Up @@ -99,7 +99,7 @@ test_expect_success \

test_expect_success \
'prepare work tree once again' \
'cat "$TEST_DIRECTORY"/../COPYING >COPYING &&
'cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
git update-index --add --remove COPYING COPYING.1'

# tree has COPYING and rezrov. work tree has COPYING and COPYING.1,
Expand Down
4 changes: 2 additions & 2 deletions t/t4005-diff-rename-2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test_description='Same rename detection as t4003 but testing diff-raw.

test_expect_success \
'prepare reference tree' \
'cat "$TEST_DIRECTORY"/../COPYING >COPYING &&
'cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
echo frotz >rezrov &&
git update-index --add COPYING rezrov &&
tree=$(git write-tree) &&
Expand Down Expand Up @@ -71,7 +71,7 @@ test_expect_success \

test_expect_success \
'prepare work tree once again' \
'cat "$TEST_DIRECTORY"/../COPYING >COPYING &&
'cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
git update-index --add --remove COPYING COPYING.1'

git diff-index -C --find-copies-harder $tree >current
Expand Down
2 changes: 1 addition & 1 deletion t/t4007-rename-3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test_description='Rename interaction with pathspec.

test_expect_success 'prepare reference tree' '
mkdir path0 path1 &&
cp "$TEST_DIRECTORY"/../COPYING path0/COPYING &&
cp "$TEST_DIRECTORY"/diff-lib/COPYING path0/COPYING &&
git update-index --add path0/COPYING &&
tree=$(git write-tree) &&
echo $tree
Expand Down
38 changes: 19 additions & 19 deletions t/t4008-diff-break-rewrite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Further, with -B and -M together, these should turn into two renames.

test_expect_success \
setup \
'cat "$TEST_DIRECTORY"/../README >file0 &&
cat "$TEST_DIRECTORY"/../COPYING >file1 &&
'cat "$TEST_DIRECTORY"/diff-lib/README >file0 &&
cat "$TEST_DIRECTORY"/diff-lib/COPYING >file1 &&
git update-index --add file0 file1 &&
tree=$(git write-tree) &&
echo "$tree"'
Expand All @@ -43,8 +43,8 @@ test_expect_success \
'git diff-index -B --cached "$tree" >current'

cat >expected <<\EOF
:100644 000000 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 0000000000000000000000000000000000000000 D file0
:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 11e331465a89c394dc25c780de230043750c1ec8 M100 file1
:100644 000000 548142c327a6790ff8821d67c2ee1eff7a656b52 0000000000000000000000000000000000000000 D file0
:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 2fbedd0b5d4b8126e4750c3bee305e8ff79f80ec M100 file1
EOF

test_expect_success \
Expand All @@ -56,7 +56,7 @@ test_expect_success \
'git diff-index -B -M "$tree" >current'

cat >expected <<\EOF
:100644 100644 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 08bb2fb671deff4c03a4d4a0a1315dff98d5732c R100 file0 file1
:100644 100644 548142c327a6790ff8821d67c2ee1eff7a656b52 2fbedd0b5d4b8126e4750c3bee305e8ff79f80ec R100 file0 file1
EOF

test_expect_success \
Expand All @@ -78,8 +78,8 @@ test_expect_success \
'git diff-index -B "$tree" >current'

cat >expected <<\EOF
:100644 100644 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 6ff87c4664981e4397625791c8ea3bbb5f2279a3 M100 file0
:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 M100 file1
:100644 100644 548142c327a6790ff8821d67c2ee1eff7a656b52 6ff87c4664981e4397625791c8ea3bbb5f2279a3 M100 file0
:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 548142c327a6790ff8821d67c2ee1eff7a656b52 M100 file1
EOF

test_expect_success \
Expand All @@ -92,7 +92,7 @@ test_expect_success \

cat >expected <<\EOF
:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 6ff87c4664981e4397625791c8ea3bbb5f2279a3 R100 file1 file0
:100644 100644 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 R100 file0 file1
:100644 100644 548142c327a6790ff8821d67c2ee1eff7a656b52 548142c327a6790ff8821d67c2ee1eff7a656b52 R100 file0 file1
EOF

test_expect_success \
Expand All @@ -110,8 +110,8 @@ test_expect_success \
'git diff-index -B "$tree" >current'

cat >expected <<\EOF
:100644 120000 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 67be421f88824578857624f7b3dc75e99a8a1481 T file0
:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 M100 file1
:100644 120000 548142c327a6790ff8821d67c2ee1eff7a656b52 67be421f88824578857624f7b3dc75e99a8a1481 T file0
:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 548142c327a6790ff8821d67c2ee1eff7a656b52 M100 file1
EOF

test_expect_success \
Expand All @@ -125,8 +125,8 @@ test_expect_success \
# file0 changed from regular to symlink. file1 is very close to the preimage of file0.
# the change does not make file0 disappear, so file1 is denoted as a copy of file0
cat >expected <<\EOF
:100644 120000 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 67be421f88824578857624f7b3dc75e99a8a1481 T file0
:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 C file0 file1
:100644 120000 548142c327a6790ff8821d67c2ee1eff7a656b52 67be421f88824578857624f7b3dc75e99a8a1481 T file0
:100644 100644 548142c327a6790ff8821d67c2ee1eff7a656b52 548142c327a6790ff8821d67c2ee1eff7a656b52 C file0 file1
EOF

test_expect_success \
Expand All @@ -140,8 +140,8 @@ test_expect_success \
# This should not mistake file0 as the copy source of new file1
# due to type differences.
cat >expected <<\EOF
:100644 120000 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 67be421f88824578857624f7b3dc75e99a8a1481 T file0
:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 M file1
:100644 120000 548142c327a6790ff8821d67c2ee1eff7a656b52 67be421f88824578857624f7b3dc75e99a8a1481 T file0
:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 548142c327a6790ff8821d67c2ee1eff7a656b52 M file1
EOF

test_expect_success \
Expand All @@ -163,9 +163,9 @@ test_expect_success \
'git diff-index -B "$tree" >current'

cat >expected <<\EOF
:100644 000000 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 0000000000000000000000000000000000000000 D file0
:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 08bb2fb671deff4c03a4d4a0a1315dff98d5732c M100 file1
:000000 100644 0000000000000000000000000000000000000000 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 A file2
:100644 000000 548142c327a6790ff8821d67c2ee1eff7a656b52 0000000000000000000000000000000000000000 D file0
:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 2fbedd0b5d4b8126e4750c3bee305e8ff79f80ec M100 file1
:000000 100644 0000000000000000000000000000000000000000 69a939f651686f56322566e2fd76715947a24162 A file2
EOF

test_expect_success \
Expand All @@ -177,8 +177,8 @@ test_expect_success \
'git diff-index -B -C "$tree" >current'

cat >expected <<\EOF
:100644 100644 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 08bb2fb671deff4c03a4d4a0a1315dff98d5732c C095 file0 file1
:100644 100644 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 59f832e5c8b3f7e486be15ad0cd3e95ba9af8998 R095 file0 file2
:100644 100644 548142c327a6790ff8821d67c2ee1eff7a656b52 2fbedd0b5d4b8126e4750c3bee305e8ff79f80ec C095 file0 file1
:100644 100644 548142c327a6790ff8821d67c2ee1eff7a656b52 69a939f651686f56322566e2fd76715947a24162 R095 file0 file2
EOF

test_expect_success \
Expand Down
4 changes: 2 additions & 2 deletions t/t4009-diff-rename-4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test_description='Same rename detection as t4003 but testing diff-raw -z.

test_expect_success \
'prepare reference tree' \
'cat "$TEST_DIRECTORY"/../COPYING >COPYING &&
'cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
echo frotz >rezrov &&
git update-index --add COPYING rezrov &&
tree=$(git write-tree) &&
Expand Down Expand Up @@ -78,7 +78,7 @@ test_expect_success \

test_expect_success \
'prepare work tree once again' \
'cat "$TEST_DIRECTORY"/../COPYING >COPYING &&
'cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING &&
git update-index --add --remove COPYING COPYING.1'

git diff-index -z -C --find-copies-harder $tree >current
Expand Down

0 comments on commit 459b8d2

Please sign in to comment.