failed test.
+Naming Tests
+------------
+
+The test files are named as:
+
+ tNNNN-commandname-details.sh
+
+where N is a decimal digit.
+
+First digit tells the family:
+
+ 0 - the absolute basics and global stuff
+ 1 - the basic commands concerning database
+ 2 - the basic commands concerning the working tree
+ 3 - the other basic commands (e.g. ls-files)
+ 4 - the diff commands
+ 5 - the pull and exporting commands
+ 6 - the revision tree commands (even e.g. merge-base)
+
+Second digit tells the particular command we are testing.
+
+Third digit (optionally) tells the particular switch or group of switches
+we are testing.
+
+
Writing Tests
-------------
This test registers the following structure in the cache
and tries to run git-ls-files with option --frotz.'
+
Source 'test-lib.sh'
--------------------
consistently when command line arguments --verbose (or -v),
--debug (or -d), and --immediate (or -i) is given.
-
End with test_done
------------------
+++ /dev/null
-#!/bin/sh
-#
-# Copyright (c) 2005 Junio C Hamano
-#
-
-test_description='git-update-cache nonsense-path test.
-
-This test creates the following structure in the cache:
-
- path0 - a file
- path1 - a symlink
- path2/file2 - a file in a directory
- path3/file3 - a file in a directory
-
-and tries to git-update-cache --add the following:
-
- path0/file0 - a file in a directory
- path1/file1 - a file in a directory
- path2 - a file
- path3 - a symlink
-
-All of the attempts should fail.
-'
-
-. ./test-lib.sh
-
-mkdir path2 path3
-date >path0
-ln -s xyzzy path1
-date >path2/file2
-date >path3/file3
-
-test_expect_success \
- 'git-update-cache --add to add various paths.' \
- 'git-update-cache --add -- path0 path1 path2/file2 path3/file3'
-
-rm -fr path?
-
-mkdir path0 path1
-date >path2
-ln -s frotz path3
-date >path0/file0
-date >path1/file1
-
-for p in path0/file0 path1/file1 path2 path3
-do
- test_expect_failure \
- "git-update-cache to add conflicting path $p should fail." \
- "git-update-cache --add -- $p"
-done
-test_done
+++ /dev/null
-#!/bin/sh
-#
-# Copyright (c) 2005 Junio C Hamano
-#
-
-test_description='git-ls-files test (--others should pick up symlinks).
-
-This test runs git-ls-files --others with the following on the
-filesystem.
-
- path0 - a file
- path1 - a symlink
- path2/file2 - a file in a directory
-'
-. ./test-lib.sh
-
-date >path0
-ln -s xyzzy path1
-mkdir path2
-date >path2/file2
-test_expect_success \
- 'git-ls-files --others to show output.' \
- 'git-ls-files --others >.output'
-cat >.expected <<EOF
-path0
-path1
-path2/file2
-EOF
-
-test_expect_success \
- 'git-ls-files --others should pick up symlinks.' \
- 'diff .output .expected'
-test_done
+++ /dev/null
-#!/bin/sh
-#
-# Copyright (c) 2005 Junio C Hamano
-#
-
-test_description='git-ls-files -k flag test.
-
-This test prepares the following in the cache:
-
- path0 - a file
- path1 - a symlink
- path2/file2 - a file in a directory
- path3/file3 - a file in a directory
-
-and the following on the filesystem:
-
- path0/file0 - a file in a directory
- path1/file1 - a file in a directory
- path2 - a file
- path3 - a symlink
- path4 - a file
- path5 - a symlink
- path6/file6 - a file in a directory
-
-git-ls-files -k should report that existing filesystem
-objects except path4, path5 and path6/file6 to be killed.
-'
-. ./test-lib.sh
-
-date >path0
-ln -s xyzzy path1
-mkdir path2 path3
-date >path2/file2
-date >path3/file3
-test_expect_success \
- 'git-update-cache --add to add various paths.' \
- "git-update-cache --add -- path0 path1 path?/file?"
-
-rm -fr path?
-date >path2
-ln -s frotz path3
-ln -s nitfol path5
-mkdir path0 path1 path6
-date >path0/file0
-date >path1/file1
-date >path6/file6
-
-test_expect_success \
- 'git-ls-files -k to show killed files.' \
- 'git-ls-files -k >.output'
-cat >.expected <<EOF
-path0/file0
-path1/file1
-path2
-path3
-EOF
-
-test_expect_success \
- 'validate git-ls-files -k output.' \
- 'diff .output .expected'
-test_done
+++ /dev/null
-#!/bin/sh
-#
-# Copyright (c) 2005 Junio C Hamano
-#
-
-test_description='git-checkout-cache test.
-
-This test registers the following filesystem structure in the
-cache:
-
- path0 - a file
- path1/file1 - a file in a directory
-
-And then tries to checkout in a work tree that has the following:
-
- path0/file0 - a file in a directory
- path1 - a file
-
-The git-checkout-cache command should fail when attempting to checkout
-path0, finding it is occupied by a directory, and path1/file1, finding
-path1 is occupied by a non-directory. With "-f" flag, it should remove
-the conflicting paths and succeed.
-'
-. ./test-lib.sh
-
-date >path0
-mkdir path1
-date >path1/file1
-
-test_expect_success \
- 'git-update-cache --add various paths.' \
- 'git-update-cache --add path0 path1/file1'
-
-rm -fr path0 path1
-mkdir path0
-date >path0/file0
-date >path1
-
-test_expect_failure \
- 'git-checkout-cache without -f should fail on conflicting work tree.' \
- 'git-checkout-cache -a'
-
-test_expect_success \
- 'git-checkout-cache with -f should succeed.' \
- 'git-checkout-cache -f -a'
-
-test_expect_success \
- 'git-checkout-cache conflicting paths.' \
- 'test -f path0 && test -d path1 && test -f path1/file1'
-
-test_done
-
-
+++ /dev/null
-#!/bin/sh
-#
-# Copyright (c) 2005 Junio C Hamano
-#
-
-test_description='git-checkout-cache test.
-
-This test registers the following filesystem structure in the cache:
-
- path0/file0 - a file in a directory
- path1/file1 - a file in a directory
-
-and attempts to check it out when the work tree has:
-
- path0/file0 - a file in a directory
- path1 - a symlink pointing at "path0"
-
-Checkout cache should fail to extract path1/file1 because the leading
-path path1 is occupied by a non-directory. With "-f" it should remove
-the symlink path1 and create directory path1 and file path1/file1.
-'
-. ./test-lib.sh
-
-show_files() {
- # show filesystem files, just [-dl] for type and name
- find path? -ls |
- sed -e 's/^[0-9]* * [0-9]* * \([-bcdl]\)[^ ]* *[0-9]* *[^ ]* *[^ ]* *[0-9]* [A-Z][a-z][a-z] [0-9][0-9] [^ ]* /fs: \1 /'
- # what's in the cache, just mode and name
- git-ls-files --stage |
- sed -e 's/^\([0-9]*\) [0-9a-f]* [0-3] /ca: \1 /'
- # what's in the tree, just mode and name.
- git-ls-tree -r "$1" |
- sed -e 's/^\([0-9]*\) [^ ]* [0-9a-f]* /tr: \1 /'
-}
-
-mkdir path0
-date >path0/file0
-test_expect_success \
- 'git-update-cache --add path0/file0' \
- 'git-update-cache --add path0/file0'
-test_expect_success \
- 'writing tree out with git-write-tree' \
- 'tree1=$(git-write-tree)'
-test_debug 'show_files $tree1'
-
-mkdir path1
-date >path1/file1
-test_expect_success \
- 'git-update-cache --add path1/file1' \
- 'git-update-cache --add path1/file1'
-test_expect_success \
- 'writing tree out with git-write-tree' \
- 'tree2=$(git-write-tree)'
-test_debug 'show_files $tree2'
-
-rm -fr path1
-test_expect_success \
- 'read previously written tree and checkout.' \
- 'git-read-tree -m $tree1 && git-checkout-cache -f -a'
-test_debug 'show_files $tree1'
-
-ln -s path0 path1
-test_expect_success \
- 'git-update-cache --add a symlink.' \
- 'git-update-cache --add path1'
-test_expect_success \
- 'writing tree out with git-write-tree' \
- 'tree3=$(git-write-tree)'
-test_debug 'show_files $tree3'
-
-# Morten says "Got that?" here.
-# Test begins.
-
-test_expect_success \
- 'read previously written tree and checkout.' \
- 'git-read-tree $tree2 && git-checkout-cache -f -a'
-test_debug show_files $tree2
-
-test_expect_success \
- 'checking out conflicting path with -f' \
- 'test ! -h path0 && test -d path0 &&
- test ! -h path1 && test -d path1 &&
- test ! -h path0/file0 && test -f path0/file0 &&
- test ! -h path1/file1 && test -f path1/file1'
-
-test_done
-
--- /dev/null
+#!/bin/sh
+#
+# Copyright (c) 2005 Junio C Hamano
+#
+
+test_description='git-checkout-cache test.
+
+This test registers the following filesystem structure in the
+cache:
+
+ path0 - a file
+ path1/file1 - a file in a directory
+
+And then tries to checkout in a work tree that has the following:
+
+ path0/file0 - a file in a directory
+ path1 - a file
+
+The git-checkout-cache command should fail when attempting to checkout
+path0, finding it is occupied by a directory, and path1/file1, finding
+path1 is occupied by a non-directory. With "-f" flag, it should remove
+the conflicting paths and succeed.
+'
+. ./test-lib.sh
+
+date >path0
+mkdir path1
+date >path1/file1
+
+test_expect_success \
+ 'git-update-cache --add various paths.' \
+ 'git-update-cache --add path0 path1/file1'
+
+rm -fr path0 path1
+mkdir path0
+date >path0/file0
+date >path1
+
+test_expect_failure \
+ 'git-checkout-cache without -f should fail on conflicting work tree.' \
+ 'git-checkout-cache -a'
+
+test_expect_success \
+ 'git-checkout-cache with -f should succeed.' \
+ 'git-checkout-cache -f -a'
+
+test_expect_success \
+ 'git-checkout-cache conflicting paths.' \
+ 'test -f path0 && test -d path1 && test -f path1/file1'
+
+test_done
+
+
--- /dev/null
+#!/bin/sh
+#
+# Copyright (c) 2005 Junio C Hamano
+#
+
+test_description='git-checkout-cache test.
+
+This test registers the following filesystem structure in the cache:
+
+ path0/file0 - a file in a directory
+ path1/file1 - a file in a directory
+
+and attempts to check it out when the work tree has:
+
+ path0/file0 - a file in a directory
+ path1 - a symlink pointing at "path0"
+
+Checkout cache should fail to extract path1/file1 because the leading
+path path1 is occupied by a non-directory. With "-f" it should remove
+the symlink path1 and create directory path1 and file path1/file1.
+'
+. ./test-lib.sh
+
+show_files() {
+ # show filesystem files, just [-dl] for type and name
+ find path? -ls |
+ sed -e 's/^[0-9]* * [0-9]* * \([-bcdl]\)[^ ]* *[0-9]* *[^ ]* *[^ ]* *[0-9]* [A-Z][a-z][a-z] [0-9][0-9] [^ ]* /fs: \1 /'
+ # what's in the cache, just mode and name
+ git-ls-files --stage |
+ sed -e 's/^\([0-9]*\) [0-9a-f]* [0-3] /ca: \1 /'
+ # what's in the tree, just mode and name.
+ git-ls-tree -r "$1" |
+ sed -e 's/^\([0-9]*\) [^ ]* [0-9a-f]* /tr: \1 /'
+}
+
+mkdir path0
+date >path0/file0
+test_expect_success \
+ 'git-update-cache --add path0/file0' \
+ 'git-update-cache --add path0/file0'
+test_expect_success \
+ 'writing tree out with git-write-tree' \
+ 'tree1=$(git-write-tree)'
+test_debug 'show_files $tree1'
+
+mkdir path1
+date >path1/file1
+test_expect_success \
+ 'git-update-cache --add path1/file1' \
+ 'git-update-cache --add path1/file1'
+test_expect_success \
+ 'writing tree out with git-write-tree' \
+ 'tree2=$(git-write-tree)'
+test_debug 'show_files $tree2'
+
+rm -fr path1
+test_expect_success \
+ 'read previously written tree and checkout.' \
+ 'git-read-tree -m $tree1 && git-checkout-cache -f -a'
+test_debug 'show_files $tree1'
+
+ln -s path0 path1
+test_expect_success \
+ 'git-update-cache --add a symlink.' \
+ 'git-update-cache --add path1'
+test_expect_success \
+ 'writing tree out with git-write-tree' \
+ 'tree3=$(git-write-tree)'
+test_debug 'show_files $tree3'
+
+# Morten says "Got that?" here.
+# Test begins.
+
+test_expect_success \
+ 'read previously written tree and checkout.' \
+ 'git-read-tree $tree2 && git-checkout-cache -f -a'
+test_debug show_files $tree2
+
+test_expect_success \
+ 'checking out conflicting path with -f' \
+ 'test ! -h path0 && test -d path0 &&
+ test ! -h path1 && test -d path1 &&
+ test ! -h path0/file0 && test -f path0/file0 &&
+ test ! -h path1/file1 && test -f path1/file1'
+
+test_done
+
--- /dev/null
+#!/bin/sh
+#
+# Copyright (c) 2005 Junio C Hamano
+#
+
+test_description='git-update-cache nonsense-path test.
+
+This test creates the following structure in the cache:
+
+ path0 - a file
+ path1 - a symlink
+ path2/file2 - a file in a directory
+ path3/file3 - a file in a directory
+
+and tries to git-update-cache --add the following:
+
+ path0/file0 - a file in a directory
+ path1/file1 - a file in a directory
+ path2 - a file
+ path3 - a symlink
+
+All of the attempts should fail.
+'
+
+. ./test-lib.sh
+
+mkdir path2 path3
+date >path0
+ln -s xyzzy path1
+date >path2/file2
+date >path3/file3
+
+test_expect_success \
+ 'git-update-cache --add to add various paths.' \
+ 'git-update-cache --add -- path0 path1 path2/file2 path3/file3'
+
+rm -fr path?
+
+mkdir path0 path1
+date >path2
+ln -s frotz path3
+date >path0/file0
+date >path1/file1
+
+for p in path0/file0 path1/file1 path2 path3
+do
+ test_expect_failure \
+ "git-update-cache to add conflicting path $p should fail." \
+ "git-update-cache --add -- $p"
+done
+test_done
--- /dev/null
+#!/bin/sh
+#
+# Copyright (c) 2005 Junio C Hamano
+#
+
+test_description='git-ls-files test (--others should pick up symlinks).
+
+This test runs git-ls-files --others with the following on the
+filesystem.
+
+ path0 - a file
+ path1 - a symlink
+ path2/file2 - a file in a directory
+'
+. ./test-lib.sh
+
+date >path0
+ln -s xyzzy path1
+mkdir path2
+date >path2/file2
+test_expect_success \
+ 'git-ls-files --others to show output.' \
+ 'git-ls-files --others >.output'
+cat >.expected <<EOF
+path0
+path1
+path2/file2
+EOF
+
+test_expect_success \
+ 'git-ls-files --others should pick up symlinks.' \
+ 'diff .output .expected'
+test_done
--- /dev/null
+#!/bin/sh
+#
+# Copyright (c) 2005 Junio C Hamano
+#
+
+test_description='git-ls-files -k flag test.
+
+This test prepares the following in the cache:
+
+ path0 - a file
+ path1 - a symlink
+ path2/file2 - a file in a directory
+ path3/file3 - a file in a directory
+
+and the following on the filesystem:
+
+ path0/file0 - a file in a directory
+ path1/file1 - a file in a directory
+ path2 - a file
+ path3 - a symlink
+ path4 - a file
+ path5 - a symlink
+ path6/file6 - a file in a directory
+
+git-ls-files -k should report that existing filesystem
+objects except path4, path5 and path6/file6 to be killed.
+'
+. ./test-lib.sh
+
+date >path0
+ln -s xyzzy path1
+mkdir path2 path3
+date >path2/file2
+date >path3/file3
+test_expect_success \
+ 'git-update-cache --add to add various paths.' \
+ "git-update-cache --add -- path0 path1 path?/file?"
+
+rm -fr path?
+date >path2
+ln -s frotz path3
+ln -s nitfol path5
+mkdir path0 path1 path6
+date >path0/file0
+date >path1/file1
+date >path6/file6
+
+test_expect_success \
+ 'git-ls-files -k to show killed files.' \
+ 'git-ls-files -k >.output'
+cat >.expected <<EOF
+path0/file0
+path1/file1
+path2
+path3
+EOF
+
+test_expect_success \
+ 'validate git-ls-files -k output.' \
+ 'diff .output .expected'
+test_done