summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)AuthorFilesLines
2011-01-27Merge branch 'maint'Libravatar Junio C Hamano2-0/+45
* maint: rebase -i: clarify in-editor documentation of "exec" tests: sanitize more git environment variables fast-import: treat filemodify with empty tree as delete rebase: give a better error message for bogus branch rebase: use explicit "--" with checkout Conflicts: t/t9300-fast-import.sh
2011-01-27tests: sanitize more git environment variablesLibravatar Jeff King1-0/+3
These variables should generally not be set in one's environment, but they do get set by rebase, which means doing an interactive rebase like: pick abcd1234 foo exec make test will cause false negatives in the test suite. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-27Merge branch 'jn/fast-import-empty-tree-removal' into maintLibravatar Junio C Hamano1-0/+42
* jn/fast-import-empty-tree-removal: fast-import: treat filemodify with empty tree as delete
2011-01-27fast-import: treat filemodify with empty tree as deleteLibravatar Jonathan Nieder1-0/+42
Normal git processes do not allow one to build a tree with an empty subtree entry without trying hard at it. This is in keeping with the general UI philosophy: git tracks content, not empty directories. v1.7.3-rc0~75^2 (2010-06-30) changed that by making it easy to include an empty subtree in fast-import's active commit: M 040000 4b825dc642cb6eb9a060e54bf8d69288fbee4904 subdir One can trigger this by reading an empty tree (for example, the tree corresponding to an empty root commit) and trying to move it to a subtree. It is better and more closely analogous to 'git read-tree --prefix' to treat such commands as requests to remove the subtree. Noticed-by: David Barr <david.barr@cordelta.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-24Merge branch 'jn/setup-fixes'Libravatar Junio C Hamano3-4453/+703
* jn/setup-fixes: t1510: fix typo in the comment of a test Documentation updates for 'GIT_WORK_TREE without GIT_DIR' historical usecase Subject: setup: officially support --work-tree without --git-dir tests: compress the setup tests tests: cosmetic improvements to the repo-setup test t/README: hint about using $(pwd) rather than $PWD in tests Fix expected values of setup tests on Windows
2011-01-24t1510: fix typo in the comment of a testLibravatar Jonathan Nieder1-1/+1
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-21Subject: setup: officially support --work-tree without --git-dirLibravatar Jonathan Nieder1-95/+115
The original intention of --work-tree was to allow people to work in a subdirectory of their working tree that does not have an embedded .git directory. Because their working tree, which their $cwd was in, did not have an embedded .git, they needed to use $GIT_DIR to specify where it is, and because this meant there was no way to discover where the root level of the working tree was, so we needed to add $GIT_WORK_TREE to tell git where it was. However, this facility has long been (mis)used by people's scripts to start git from a working tree _with_ an embedded .git directory, let git find .git directory, and then pretend as if an unrelated directory were the associated working tree of the .git directory found by the discovery process. It happens to work in simple cases, and is not worth causing "regression" to these scripts. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-19tests: compress the setup testsLibravatar Jonathan Nieder1-4401/+618
New test helpers: - setup_repo, to initialize a repository or gitfile pointing to a repository, with core.bare and core.worktree set as specified; - try_case, to run setup from a given directory and validate the result, with GIT_DIR and GIT_WORK_TREE set as specified; - try_repo, to initialize a repository and call "try_case" from the toplevel and a subdirectory; - run_wt_tests, to run a battery of tests that check for sane behavior when GIT_WORK_TREE is set to various positions relative to the .git dir and cwd. Use these helpers to make the test shorter, less repetitive, and (one hopes) easier to understand and modify. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-19tests: cosmetic improvements to the repo-setup testLibravatar Jonathan Nieder1-44/+50
Give an overview in "sh t1510-repo-setup.sh --help" output. Waste some vertical and horizontal space for clearer code. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-19Merge branch 'tr/submodule-relative-scp-url' into maintLibravatar Junio C Hamano1-0/+38
* tr/submodule-relative-scp-url: submodule: fix relative url parsing for scp-style origin
2011-01-19Merge branch 'rj/maint-test-fixes' into maintLibravatar Junio C Hamano4-23/+35
* rj/maint-test-fixes: t9501-*.sh: Fix a test failure on Cygwin lib-git-svn.sh: Add check for mis-configured web server variables lib-git-svn.sh: Avoid setting web server variables unnecessarily t9142: Move call to start_httpd into the setup test t3600-rm.sh: Don't pass a non-existent prereq to test #15
2011-01-19Merge branch 'jn/submodule-b-current' into maintLibravatar Junio C Hamano1-5/+23
* jn/submodule-b-current: git submodule: Remove now obsolete tests before cloning a repo git submodule -b ... of current HEAD fails
2011-01-19Merge branch 'jc/maint-svn-info-test-fix' into maintLibravatar Junio C Hamano1-72/+34
* jc/maint-svn-info-test-fix: t9119: do not compare "Text Last Updated" line from "svn info"
2011-01-13Merge branch 'jn/perl-funcname'Libravatar Junio C Hamano1-1/+1
* jn/perl-funcname: userdiff/perl: catch BEGIN/END/... and POD as headers diff: funcname and word patterns for perl
2011-01-13Merge branch 'rj/svn-test'Libravatar Junio C Hamano1-17/+21
* rj/svn-test: lib-git-svn.sh: Move web-server handling code into separate function
2011-01-13Merge branch 'rj/test-fixes'Libravatar Junio C Hamano3-2/+12
* rj/test-fixes: t4135-*.sh: Skip the "backslash" tests on cygwin t3032-*.sh: Do not strip CR from line-endings while grepping on MinGW t3032-*.sh: Pass the -b (--binary) option to sed on cygwin t6038-*.sh: Pass the -b (--binary) option to sed on cygwin Conflicts: t/t3032-merge-recursive-options.sh
2011-01-13Merge branch 'jn/t9010-work-around-broken-svnadmin'Libravatar Junio C Hamano1-20/+15
* jn/t9010-work-around-broken-svnadmin: t9010: svnadmin can fail even if available
2011-01-13Merge branch 'tr/submodule-relative-scp-url'Libravatar Junio C Hamano1-0/+38
* tr/submodule-relative-scp-url: submodule: fix relative url parsing for scp-style origin
2011-01-13t0000: quote TAP snippets in test codeLibravatar Thomas Rast1-18/+18
t0000 contains two snippets of actual test output. This causes problems when passing -v to the test[*]: the test infrastructure echoes the tests before running them, and the TAP parser then sees this test output and concludes that two tests failed and that the TAP output was badly formatted. Guard against this by quoting the output in the source. [*] either by running 'make smoke' with GIT_TEST_OPTS=-v, or with prove ./t0000-basic.sh :: -v Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-11t9157-*.sh: Make the svn version check more preciseLibravatar Ramsay Jones1-1/+1
These tests require an svn version 1.5 or newer to run correctly. In particular, all 1.4.x versions and earlier are too old, so fix up the case label regex to cover this range exactly. [Fix provided by Anders Kaseorg <andersk@MIT.EDU>] Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-11t/README: hint about using $(pwd) rather than $PWD in testsLibravatar Johannes Sixt1-0/+6
This adds just a "do it this way" instruction without a lot of explanation, because the details are too complex to be explained at this point. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-11Fix expected values of setup tests on WindowsLibravatar Johannes Sixt2-1167/+1168
On Windows, bash stores absolute path names in shell variables in POSIX format that begins with a slash, rather than in drive-letter format; such a value is converted to the latter format when it is passed to a non-MSYS program such as git. When an expected test value is constructed, it must contain the value that will be produced by git, which will be in the drive-letter format. But TRASH_DIRECTORY is in POSIX format. Fix this by using $(pwd), which produces drive-letter format since 4114156a (Tests on Windows: $(pwd) must return Windows-style paths). The change in t1510 is a straight seach-and-replace, except for the first hunk of the diff. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-10t9010: svnadmin can fail even if availableLibravatar Jonathan Nieder1-20/+15
If svn is built against one version of SQLite and run against another, libsvn_subr needlessly errors out in operations that need to make a commit. That is clearly not a bug in git but let us consider the ramifications for the test suite. git-svn uses libsvn directly and is probably broken by that bug; it is right for git-svn tests to fail. The vcs-svn lib, on the other hand, does not use libsvn and the test t9010 only uses svn to check its work. This points to two possible improvements: - do not disable most vcs-svn tests if svn is missing. - skip validation rather than failing it when svn fails. Bring about both by putting the svn invocations into a single test that builds a repo to compare the test-svn-fe result against. The test will always pass but only will set the new SVNREPO test prereq if svn succeeds; and validation using that repo gets an SVNREPO prerequisite so it only runs with working svn installations. Works-around: http://bugs.debian.org/608925 Noticed-by: A Large Angry SCM <gitzilla@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2011-01-10submodule: fix relative url parsing for scp-style originLibravatar Thomas Rast1-0/+38
The function resolve_relative_url was not prepared to deal with an scp-style origin 'user@host:path' in the case where 'path' is only a single component. Fix this by extending the logic that strips one path component from the $remoteurl. Also add tests for both styles of URLs. Noticed-by: Jeffrey Phillips Freeman <jeffrey.freeman@syncleus.com> Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-08t4135-*.sh: Skip the "backslash" tests on cygwinLibravatar Ramsay Jones1-1/+0
The BSLASHPSPEC tests (11-13) fail on cygwin, since you can't create files containing an backslash character in the name. In order to skip these tests, we simply stop (incorrectly) asserting the BSLASHPSPEC prerequisite in test-lib.sh. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Acked-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-08t3032-*.sh: Do not strip CR from line-endings while grepping on MinGWLibravatar Ramsay Jones1-0/+1
By default grep reads in text mode and converts CRLF into LF line endings, which causes tests 4, 6 and 8 to fail. In a similar manner to commit a94114ad (Do not strip CR when grepping HTTP headers, 2010-09-12), we set (and export) the GREP_OPTIONS variable to -U so that grep will use binary mode. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Acked-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-08t3032-*.sh: Pass the -b (--binary) option to sed on cygwinLibravatar Ramsay Jones1-1/+3
The test using the conflict_hunks helper function (test 9) fails on cygwin, since sed (by default) throws away the CR from CRLF line endings. This behaviour is undesirable, since the validation code expects the CRLF line-ending to be present. In order to fix the problem we pass the -b (--binary) option to sed, using the SED_OPTIONS variable. We use the SED_STRIPS_CR prerequisite in the conditional initialisation of SED_OPTIONS. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Acked-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-08t6038-*.sh: Pass the -b (--binary) option to sed on cygwinLibravatar Ramsay Jones2-1/+9
The tests using the fuzz_conflict helper function (tests 5-6) fail on cygwin in the same way they used to on MinGW, prior to commit ca02ad3. The solution is also the same; passing the -b (--binary) option to sed, using the SED_OPTIONS variable. We introduce a new prerequisite SED_STRIPS_CR to use in the conditional initialisation of SED_OPTIONS, rather than MINGW. The new prerequisite is set in test-lib.sh for both MinGW and Cygwin. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Acked-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-07t9157-*.sh: Add an svn version checkLibravatar Ramsay Jones1-0/+8
Acked-by: Eric Wong <normalperson@yhbt.net> Acked-by: Steven Walter <stevenrwalter@gmail.com> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
2011-01-06t3032: limit sed branch labels to 8 charactersLibravatar Brandon Casey1-3/+3
POSIX leaves as unspecified the handling of labels greater than 8 characters. Apparently, Sun decided to treat them as errors. Make sed on Solaris happy by trimming the length of labels to 8 characters. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-06t0001,t1510,t3301: use sane_unset which always returns with status 0Libravatar Brandon Casey3-37/+37
On some shells (like /usr/xpg4/bin/sh on Solaris), unset will exit non-zero when passed the name of a variable that has not been set. Use sane_unset instead so that the return value of unset can be ignored while the && linkage of the test script can be preserved. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-05Merge branch 'jn/svn-fe' (early part)Libravatar Junio C Hamano1-22/+37
* 'jn/svn-fe' (early part): vcs-svn: Error out for v3 dumps Conflicts: t/t9010-svn-fe.sh
2011-01-05Merge branch 'ao/t9001-fix'Libravatar Junio C Hamano1-4/+4
* ao/t9001-fix: t/t9001-send-email.sh: fix '&&' chain in some tests
2011-01-05Merge branch 'pw/convert-pathname-substitution'Libravatar Junio C Hamano1-0/+43
* pw/convert-pathname-substitution: t0021: avoid getting filter killed with SIGPIPE convert filter: supply path to external driver
2011-01-05Merge branch 'mg/cvsimport'Libravatar Junio C Hamano1-2/+5
* mg/cvsimport: cvsimport: handle the parsing of uppercase config options cvsimport: partial whitespace cleanup
2011-01-04t/t9001-send-email.sh: fix '&&' chain in some testsLibravatar Antonio Ospite1-4/+4
t/README recommends chaining test assertions. Signed-off-by: Antonio Ospite <ospite@studenti.unina.it> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-04lib-git-svn.sh: Move web-server handling code into separate functionLibravatar Ramsay Jones1-17/+21
This library file is currently sourced by 57 test files, of which only four may (optionally) start a web-server in order to access the svn repo via an http url, rather than a file url. In addition to isolating the current web-server handling code from the majority of tests, in a new prepare_httpd function, we also add some more error checking and reporting code to validate the apache installation. Only those tests which attempt to start the web-server, by calling start_httpd, will execute this code. Note that it is important for start_httpd to return an error indication, if prepare_httpd fails, so that the failure to use the web-server, as requested by the user, should not go unnoticed. (Unless the svnrepo variable is set to an http url at the end of start_httpd, the remaining tests will use file urls, without comment.) Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-04cvsimport: handle the parsing of uppercase config optionsLibravatar Michael J Gruber1-2/+5
The current code leads to fatal: bad config value for 'cvsimport.r' in .git/config for a standard use case with cvsimport.r set. cvsimport sets internal variables by checking the config for each possible command line option. The problem is that config items are case insensitive, so config.r and config.R are the same. The ugly error is due to that fact that cvsimport expects a bool for -R (and thus config.R) but a remote name for -r (and thus config.r). Fix this by making cvsimport expect long names for uppercase options. config options for cvsimport have been undocumented so far, though present in the code and advertised in several tutorials. So one may read "enhance" for "fix". Similarly, the names for the options are "documented" in the code, waitiing for their lowercase equivalents to be transformed into long config options, as well. Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-04Merge branch 'maint'Libravatar Junio C Hamano1-2/+2
* maint: gitweb: skip logo in atom feed when there is none t9001: Fix test prerequisites
2010-12-29t9001: Fix test prerequisitesLibravatar Robin H. Johnson1-2/+2
Add in missing Perl prerequisites for new tests of send-email. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-28Merge branch 'maint'Libravatar Junio C Hamano1-1/+2
* maint: Prepare for 1.7.3.5 Fix false positives in t3404 due to SHELL=/bin/false close file on error in read_mmfile() Conflicts: RelNotes
2010-12-28Merge branch 'jk/commit-die-on-bogus-ident' into maintLibravatar Junio C Hamano1-0/+4
* jk/commit-die-on-bogus-ident: commit: die before asking to edit the log message ident: die on bogus date format
2010-12-28Merge branch 'ks/blame-worktree-textconv-cached' into maintLibravatar Junio C Hamano1-0/+21
* ks/blame-worktree-textconv-cached: fill_textconv(): Don't get/put cache if sha1 is not valid t/t8006: Demonstrate blame is broken when cachetextconv is on
2010-12-28Merge branch 'jc/maint-rebase-rewrite-last-skip' into maintLibravatar Junio C Hamano1-1/+17
* jc/maint-rebase-rewrite-last-skip: rebase --skip: correctly wrap-up when skipping the last patch
2010-12-28Merge branch 'jc/maint-am-abort-safely' into maintLibravatar Junio C Hamano1-0/+9
* jc/maint-am-abort-safely: am --abort: keep unrelated commits since the last failure and warn
2010-12-28t9001: use older Getopt::Long boolean prefix '--no' rather than '--no-'Libravatar Brandon Casey1-1/+1
The '--no-chain-reply-to' option is a Getopt::Long boolean option. The '--no-' prefix (as in --no-chain-reply-to) for boolean options is not supported in Getopt::Long version 2.32 which was released with Perl 5.8.0. This version only supports '--no' as in '--nochain-reply-to'. More recent versions of Getopt::Long, such as version 2.34, support either prefix. So use the older form in the tests. See also: 907a0b1e04ea31cb368e9422df93d8ebb0187914 84eeb687de7a6c7c42af3fb51b176e0f412a979e 3fee1fe87144360a1913eab86af9ad136c810076 Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-28Merge branch 'jc/maint-rebase-rewrite-last-skip'Libravatar Junio C Hamano1-1/+17
* jc/maint-rebase-rewrite-last-skip: rebase --skip: correctly wrap-up when skipping the last patch
2010-12-28Merge branch 'nd/setup'Libravatar Junio C Hamano4-0/+4603
* nd/setup: (47 commits) setup_work_tree: adjust relative $GIT_WORK_TREE after moving cwd git.txt: correct where --work-tree path is relative to Revert "Documentation: always respect core.worktree if set" t0001: test git init when run via an alias Remove all logic from get_git_work_tree() setup: rework setup_explicit_git_dir() setup: clean up setup_discovered_git_dir() t1020-subdirectory: test alias expansion in a subdirectory setup: clean up setup_bare_git_dir() setup: limit get_git_work_tree()'s to explicit setup case only Use git_config_early() instead of git_config() during repo setup Add git_config_early() git-rev-parse.txt: clarify --git-dir t1510: setup case #31 t1510: setup case #30 t1510: setup case #29 t1510: setup case #28 t1510: setup case #27 t1510: setup case #26 t1510: setup case #25 ...
2010-12-28Fix false positives in t3404 due to SHELL=/bin/falseLibravatar Robin H. Johnson1-1/+2
If the user's shell in NSS passwd is /bin/false (eg as found during Gentoo's package building), the git-rebase exec tests will fail, because they call $SHELL around the command, and in the existing testcase, $SHELL was not being cleared sufficently. This lead to false positive failures of t3404 on systems where the package build user was locked down as noted above. Signed-off-by: "Robin H. Johnson" <robbat2@gentoo.org> X-Gentoo-Bug: 349083 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=349083 Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-27diff: funcname and word patterns for perlLibravatar Jonathan Nieder1-1/+1
The default function name discovery already works quite well for Perl code... with the exception of here-documents (or rather their ending). sub foo { print <<END here-document END return 1; } The default funcname pattern treats the unindented END line as a function declaration and puts it in the @@ line of diff and "grep --show-function" output. With a little knowledge of perl syntax, we can do better. You can try it out by adding "*.perl diff=perl" to the gitattributes file. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>