path: root/t/
AgeCommit message (Collapse)Author
2013-06-07tests: use test_ln_s_add to remove SYMLINKS prerequisite (trivial cases)Johannes Sixt
There are many instances where the treatment of symbolic links in the object model and the algorithms are tested, but where it is not necessary to actually have a symbolic link in the worktree. Make adjustments to the tests and remove the SYMLINKS prerequisite when appropriate in trivial cases, where "trivial" means: - merely a replacement of 'ln -s a b && git add b' by test_ln_s_add is needed; - a test for symbolic link on the file system can be split off (and remains protected by SYMLINKS); - existing code is equivalent to test_ln_s_add. Signed-off-by: Johannes Sixt <> Signed-off-by: Junio C Hamano <>
2012-06-25tests: enclose $PERL_PATH in double quotesJunio C Hamano
Otherwise it will be split at a space after "Program" when it is set to "\\Program Files\perl" or something silly like that. Signed-off-by: Junio C Hamano <>
2012-06-12t: Replace 'perl' by $PERL_PATHVincent van Ravesteijn
GIT-BUILD-OPTIONS defines PERL_PATH to be used in the test suite. Only a few tests already actually use this variable when perl is needed. The other test just call 'perl' and it might happen that the wrong perl interpreter is used. This becomes problematic on Windows, when the perl interpreter that is compiled and installed on the Windows system is used, because this perl interpreter might introduce some unexpected LF->CRLF conversions. This patch makes sure that $PERL_PATH is used everywhere in the test suite and that the correct perl interpreter is used. Signed-off-by: Vincent van Ravesteijn <> Signed-off-by: Junio C Hamano <>
2012-01-10Use perl instead of sed for t8006-blame-textconv testBen Walton
In test 'blame --textconv with local changes' of t8006-blame-textconv, using /usr/xpg4/bin/sed (as set by SANE_TOOL_PATH), an additional newline was added to the output from the 'helper' script. This was noted by sed with a message such as: sed: Missing newline at end of file zero.bin. Sed then exits with status 2 causing the helper script to also exit with status 2. In turn, this was triggering a fatal error from git blame: fatal: unable to read files to diff To work around this difference in sed behaviour, use perl -p instead of sed -e as it exits cleanly and does not insert the additional newline. Signed-off-by: Ben Walton <> Signed-off-by: Junio C Hamano <>
2011-11-01Merge branch 'ss/blame-textconv-fake-working-tree'Junio C Hamano
* ss/blame-textconv-fake-working-tree: (squash) test for previous blame.c: Properly initialize strbuf after calling, textconv_object() Conflicts: t/
2011-10-28(squash) test for previousJunio C Hamano
Signed-off-by: Junio C Hamano <>
2011-03-21Work around broken ln on solaris as used in t8006Ben Walton
The test setup in uses "ln -sf" to overwrite an existing symlink. Unfortunately, both /usr/bin/ln and /usr/xpg4/bin/ln on solaris 9 don't properly handle -f and -s used at the same time. This caused the test setup and subsequent checks to fail. Instead, remove the symlink and then create a new one in the setup code. The upstream Solaris bug (fixed in 10, but not 9) is documented here: Signed-off-by: Ben Walton <> Signed-off-by: Junio C Hamano <>
2010-12-20fill_textconv(): Don't get/put cache if sha1 is not validKirill Smelkov
When blaming files in the working tree, the filespec is marked with !sha1_valid, as we have not given the contents an object name yet. The function to cache textconv results (keyed on the object name), however, didn't check this condition, and ended up on storing the cached result under a random object name. Cc: Axel Bonnet <> Cc: Clément Poulain <> Cc: Diane Gasselin <> Cc: Jeff King <> Signed-off-by: Kirill Smelkov <> Signed-off-by: Junio C Hamano <>
2010-12-20t/t8006: Demonstrate blame is broken when cachetextconv is onKirill Smelkov
I have a git repository with lots of .doc and .pdf files. There diff works ok, but blaming is painfully slow without textconv cache, and with textconv cache, blame says lots of lines are 'Not Yet Committed' which is wrong. Here is a test that demonstrates the problem. Cc: Axel Bonnet <> Cc: Clément Poulain <> Cc: Diane Gasselin <> Cc: Jeff King <> Signed-off-by: Kirill Smelkov <> Signed-off-by: Junio C Hamano <>
2010-09-29blame,cat-file --textconv: Don't assume mode is ``S_IFREF | 0664''Kirill Smelkov
We need to get the correct mode when blame reads the source from the working tree, the index, or trees. This allows us to omit running textconv filters on symbolic links. Signed-off-by: Kirill Smelkov <> Reviewed-by: Matthieu Moy <> Signed-off-by: Junio C Hamano <>
2010-09-29blame,cat-file: Demonstrate --textconv is wrongly running converter on symlinksKirill Smelkov
git blame --textconv is wrongly calling the textconv filter on symlinks: symlinks are stored as blobs whose content is the target of the link, and blame calls the textconv filter on a temporary file filled-in with the content of this blob. For example: $ git blame -C -C regular-file.pdf Error: May not be a PDF file (continuing anyway) Error: PDF file is damaged - attempting to reconstruct xref table... Error: Couldn't find trailer dictionary Error: Couldn't read xref table Warning: program returned non-zero exit code #1 fatal: unable to read files to diff That errors come from pdftotext run on symlink.pdf being extracted to /tmp/ with one-line plain-text content pointing to link destination. So several failures are demonstrated here: - git cat-file --textconv :symlink.bin # also HEAD:symlink.bin - git blame --textconv symlink.bin - git blame -C -C --textconv regular-file # but also looks on symlink.bin At present they all fail with something like. E: /tmp/j3ELEs_symlink.bin is not "binary" file NOTE: git diff doesn't try to textconv the pathnames, it runs the textual diff without textconv, which is the expected behavior. Signed-off-by: Kirill Smelkov <> Reviewed-by: Matthieu Moy <> Signed-off-by: Junio C Hamano <>
2010-09-29blame,cat-file: Prepare --textconv tests for correctly-failing conversion ↵Kirill Smelkov
program The textconv filter is sometimes incorrectly ran on a temporary file whose content is the target of a symbolic link, instead of actual file content. Prepare to test this by marking the content of the file to convert with "bin:", and let the helper die if "bin:" is not found in the file content. NOTE: I've changed $@ to $1 in helper becase textconv program "should take a single argument" (see Documentation/gitattributes.txt), so making this more explicit makes sense and also helps to avoid problems with feeding arguments to echo. Signed-off-by: Kirill Smelkov <> Reviewed-by: Matthieu Moy <> Signed-off-by: Junio C Hamano <>
2010-06-18t/t8006: test textconv support for blameAxel Bonnet
Test the correct functionning of textconv with blame <file> and blame HEAD^ <file>. Test the case when no driver is specified. Signed-off-by: Axel Bonnet <> Signed-off-by: Clément Poulain <> Signed-off-by: Diane Gasselin <> Signed-off-by: Junio C Hamano <>