path: root/t/
AgeCommit message (Collapse)Author
2013-10-23Merge branch 'mg/more-textconv'Junio C Hamano
Make "git grep" and "git show" pay attention to --textconv when dealing with blob objects. * mg/more-textconv: grep: honor --textconv for the case rev:path grep: allow to use textconv filters t7008: demonstrate behavior of grep with textconv cat-file: do not die on --textconv without textconv filters show: honor --textconv for blobs diff_opt: track whether flags have been set explicitly t4030: demonstrate behavior of show with textconv
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 <>
2013-05-10cat-file: do not die on --textconv without textconv filtersMichael J Gruber
When a command is supposed to use textconv filters (by default or with "--textconv") and none are configured then the blob is output without conversion; the only exception to this rule is "cat-file --textconv". Make it behave like the rest of textconv aware commands. Signed-off-by: Michael J Gruber <> 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/t8007: test textconv support for cat-fileClément Poulain
Test the correct functionning of textconv with cat-file <sha1:blob> and cat-file HEAD^ <file>. Test the case when no driver is specified Signed-off-by: Clément Poulain <> Signed-off-by: Diane Gasselin <> Signed-off-by: Axel Bonnet <> Signed-off-by: Junio C Hamano <>