aboutsummaryrefslogtreecommitdiff
path: root/t/diff-lib.sh
Commit message (Collapse)AuthorAge
* t/diff-lib: check exact object names in compare_diff_rawJunio C Hamano2015-02-15
| | | | | | | | | | | | | | | | | | | The "sanitize" helper wanted to strip the similarity and dissimilarity scores when making comparison, but it was stripping away the object names as well. While we do not want to require the exact object names the tests expect to be maintained, as it would be seen as an extra burden, this would have prevented us catching a silly bug such as showing non 0{40} object name on the preimage side of an addition or on the postimage side of a deletion, because all [0-9a-f]{40} strings were considered equally OK. In the longer term, when a test only wants to see the status of the change without having to worry about object names, it should be rewritten not to inspect the raw format. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* tests: move convenience regexp to match object names to test-lib.shJunio C Hamano2010-01-03
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* tests: do not use implicit "git diff --no-index"Junio C Hamano2008-05-24
| | | | | | | | | | | As a general principle, we should not use "git diff" to validate the results of what git command that is being tested has done. We would not know if we are testing the command in question, or locating a bug in the cute hack of "git diff --no-index". Rather use test_cmp for that purpose. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* more tr portability test script fixesJeff King2008-03-13
| | | | | | | | | | | | | | Dealing with NULs is not always safe with tr. On Solaris, incoming NULs are silently deleted by both the System V and UCB versions of tr. When converting to NULs, the System V version works fine, but the UCB version silently ignores the request to convert the character. This patch changes all instances of tr using NULs to use "perl -pe 'y///'" instead. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* the use of 'tr' in the test suite isn't really portableH.Merijn Brand2007-12-17
| | | | | | | | | | Some versions of 'tr' only accept octal codes if entered with three digits, and therefor misinterpret the '\0' in the test suite. Some versions of 'tr' reject the (needless) use of character classes. Signed-off-by: H.Merijn Brand <h.m.brand@xs4all.nl> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Fix permissions on test scriptsAlex Riesen2007-04-16
| | | | | | | | Make every test executable. Remove exec-attribute from included shell files, they can't used standalone anyway. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Get rid of the dependency to GNU diff in the testsJohannes Schindelin2007-03-04
| | | | | | | | | | | | | | | 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)
* Show original and resulting blob object info in diff output.Junio C Hamano2005-10-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds more cruft to diff --git header to record the blob SHA1 and the mode the patch/diff is intended to be applied against, to help the receiving end fall back on a three-way merge. The new header looks like this: diff --git a/apply.c b/apply.c index 7be5041..8366082 100644 --- a/apply.c +++ b/apply.c @@ -14,6 +14,7 @@ // files that are being modified, but doesn't apply the patch // --stat does just a diffstat, and doesn't actually apply +// --show-index-info shows the old and new index info for... ... Upon receiving such a patch, if the patch did not apply cleanly to the target tree, the recipient can try to find the matching old objects in her object database and create a temporary tree, apply the patch to that temporary tree, and attempt a 3-way merge between the patched temporary tree and the target tree using the original temporary tree as the common ancestor. The patch lifts the code to compute the hash for an on-filesystem object from update-index.c and makes it available to the diff output routine. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Adjust diff-raw tests to the status letter change.Junio C Hamano2005-07-26
| | | | | | | | | | | We use 'A' for added files instead of 'N' to make the it visually easier to distinguish from 'M' now. While we are at it, make the test scripts executable. Yes, I know it does not matter because t/Makefile runs them explicitly with "sh tXXXX-blah.sh", but being consistent is always better. Signed-off-by: Junio C Hamano <junkio@cox.net>
* [PATCH] diff: consolidate test helper script pieces.Junio C Hamano2005-05-31
There were duplicate script pieces to help comparing diff output, which this patch consolidates into the t/diff-lib.sh library. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>