summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)AuthorFilesLines
2011-03-30t8001: check the exit status of the command being testedLibravatar Junio C Hamano1-5/+6
Avoid running the command being tested as an upstream of a pipe; doing so will lose its exit status. While at it, modernise the style of the script. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-30Typos: t/READMELibravatar Michael Witten1-5/+4
Signed-off-by: Michael Witten <mfwitten@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-29HOME must be set before calling git-init when creating test repositoriesLibravatar Alex Riesen1-3/+3
Otherwise the created test repositories will be affected by users ~/.gitconfig. For example, setting core.logAllrefupdates in users config will make all calls to "git config --unset core.logAllrefupdates" fail which will break the first test which uses the statement and expects it to succeed. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-20Merge branch 'so/submodule-no-update-first-time' into maintLibravatar Junio C Hamano1-0/+52
* so/submodule-no-update-first-time: t7406: "git submodule update {--merge|--rebase]" with new submodules submodule: no [--merge|--rebase] when newly cloned
2011-03-20Merge branch 'mo/perl-bidi-pipe-envfix' into maintLibravatar Junio C Hamano1-0/+10
* mo/perl-bidi-pipe-envfix: perl: command_bidi_pipe() method should set-up git environmens
2011-03-20Merge branch 'ae/better-template-failure-report' into maintLibravatar Junio C Hamano1-0/+13
* ae/better-template-failure-report: Improve error messages when temporary file creation fails
2011-03-20Work around broken ln on solaris as used in t8006Libravatar Ben Walton1-1/+2
The test setup in t8006-blame-textconv.sh 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: http://bugs.opensolaris.org/view_bug.do?bug_id=4372462 Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-20t/README: Add a note about running commands under valgrindLibravatar Carlos Martín Nieto1-0/+7
The test suite runs valgrind with certain options activated. Add a note saying how to run commands under the same conditions as the test suite does. Signed-off-by: Carlos Martín Nieto <cmn@elego.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-16Merge branch 'jn/maint-commit-missing-template' into maintLibravatar Junio C Hamano1-3/+11
* jn/maint-commit-missing-template: commit: error out for missing commit message template
2011-03-16Merge branch 'lt/rename-no-extra-copy-detection' into maintLibravatar Junio C Hamano5-6/+6
* lt/rename-no-extra-copy-detection: diffcore-rename: improve estimate_similarity() heuristics diffcore-rename: properly honor the difference between -M and -C for_each_hash: allow passing a 'void *data' pointer to callback
2011-03-16Merge branch 'jk/diffstat-binary' into maintLibravatar Junio C Hamano1-0/+7
* jk/diffstat-binary: diff: don't retrieve binary blobs for diffstat diff: handle diffstat of rewritten binary files
2011-03-16Merge branch 'jn/test-terminal-punt-on-osx-breakage' into maintLibravatar Junio C Hamano1-3/+19
* jn/test-terminal-punt-on-osx-breakage: tests: skip terminal output tests on OS X
2011-03-16Merge branch 'jk/fail-null-clone' into maintLibravatar Junio C Hamano1-0/+13
* jk/fail-null-clone: clone: die when trying to clone missing local path
2011-03-16Merge branch 'mg/placeholders-are-lowercase' into maintLibravatar Junio C Hamano1-1/+1
* mg/placeholders-are-lowercase: Make <identifier> lowercase in Documentation Make <identifier> lowercase as per CodingGuidelines Make <identifier> lowercase as per CodingGuidelines Make <identifier> lowercase as per CodingGuidelines CodingGuidelines: downcase placeholders in usage messages
2011-03-16Merge branch 'mg/patch-id' into maintLibravatar Junio C Hamano1-0/+36
* mg/patch-id: git-patch-id: do not trip over "no newline" markers git-patch-id: test for "no newline" markers
2011-03-16Merge branch 'js/maint-merge-use-prepare-commit-msg-hook' into maintLibravatar Junio C Hamano1-0/+12
* js/maint-merge-use-prepare-commit-msg-hook: merge: honor prepare-commit-msg hook
2011-03-16valgrind: ignore SSE-based strlen invalid readsLibravatar Carlos Martín Nieto1-0/+6
Some versions of strlen use SSE to speed up the calculation and load 4 bytes at a time, even if it means reading past the end of the allocated memory. This read is safe and when the strlen function is inlined, it is not replaced by valgrind, which reports a false-possitive. Tell valgrind to ignore this particular error, as the read is, in fact, safe. Current upstream-released version 3.6.1 is affected. Some distributions have this fixed in their latest versions. Signed-off-by: Carlos Martín Nieto <cmn@elego.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-09Fix typo in t/READMELibravatar Mathias Lafeldt1-1/+1
Signed-off-by: Mathias Lafeldt <misfire@debugon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-25commit: error out for missing commit message templateLibravatar Jonathan Nieder1-3/+11
When "git commit" was rewritten in C (v1.5.4-rc0~78^2~30, 2007-11-08), a subtle bug in --template was introduced. If the file named by a --template parameter is missing, previously git would error out with a message: Commit template file does not exist. but in the C version the --template parameter gets ignored and the default template is used. t7500 has two tests for this case which would have caught it, except that with the default $EDITOR, the commit message template is left unmodified, causing 'git commit' to error out and the test to succeed. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-22diff: handle diffstat of rewritten binary filesLibravatar Jeff King1-0/+7
The logic in builtin_diffstat assumes that a complete_rewrite pair should have its lines counted. This is nonsensical for binary files and leads to confusing things like: $ git diff --stat --summary HEAD^ HEAD foo.rand | Bin 4096 -> 4096 bytes 1 files changed, 0 insertions(+), 0 deletions(-) $ git diff --stat --summary -B HEAD^ HEAD foo.rand | 34 +++++++++++++++------------------- 1 files changed, 15 insertions(+), 19 deletions(-) rewrite foo.rand (100%) So let's reorder the function to handle binary files first (which from diffstat's perspective look like complete rewrites anyway), then rewrites, then actual diffstats. There are two bonus prizes to this reorder: 1. It gets rid of a now-superfluous goto. 2. The binary case is at the top, which means we can further optimize it in the next patch. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-21t/t7500-commit.sh: use test_cmp instead of testLibravatar Ævar Arnfjörð Bjarmason1-1/+6
Change commit_msg_is() in t/t7500-commit.sh to use test_cmp instead of the shell's test function. Now if a test fails we'll get test_cmp output showing us what failed. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-21t/gitweb-lib.sh: Ensure that errors are shown for --debug --immediateLibravatar Ævar Arnfjörð Bjarmason3-88/+6
Because '--immediate' stops test suite after first error, therefore in this mode test_debug 'cat gitweb.log' was never ran, thus in effect negating effect of '--debug' option. This made finidng the cause of errors in gitweb test sute difficult. Modify the gitweb_run test subroutine to run test_debug itself in the case of errors (and also remove "test_debug 'cat gitweb.log'" from gitweb tests). This makes it possible to run *gitweb tests* with --immediate ---debug combination of options; also it makes gitweb tests to not output spurious debug data that is not considered error. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Jakub Narębski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-18diffcore-rename: properly honor the difference between -M and -CLibravatar Linus Torvalds5-6/+6
We would allow rename detection to do copy detection even when asked purely for renames. That confuses users, but more importantly it can terminally confuse the recursive merge rename logic. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-18clone: die when trying to clone missing local pathLibravatar Jeff King1-0/+13
Since 86ac751 (Allow cloning an empty repository, 2009-01-23), doing: git clone does-not-exist has created does-not-exist as an empty repository. This was an unintentional side effect of 86ac751. Even weirder, doing: git clone does-not-exist new-dir _does_ fail, making this "feature" (if you want to consider it such) broken. Let's detect this situation and explicitly die. It's almost certainly not what the user intended. This patch also adds two tests. One for the missing path case, and one to confirm that a similar case, cloning a non-repository directory, fails. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-17tests: skip terminal output tests on OS XLibravatar Jonathan Nieder1-3/+19
On Mac OS X 10.5.0, test_terminal gets stuck reading from the pty master every once in a while. To reproduce the problem: perl -MIO::Pty -MFile::Copy -e ' for (my $i = 0;; $i++) { my $master = new IO::Pty; my $slave = $master->slave; if (fork == 0) { close $master or die "close: $!"; open STDOUT, ">&", $slave or die "dup2: $!"; close $slave or die "close: $!"; exec("echo", "hi", $i) or die "exec: $!"; } close $slave or die "close: $!"; copy($master, \*STDOUT) or die "copy: $!"; close $master or die "close: $!"; wait; } ' It blocks after 7000 iterations or so in sysread(). The relevant sysread() call is the second call by the parent, which presumably executes before the child dies but after the parent has read all output from there. Since this is an intermitent problem, the quick check of terminal support in lib-terminal doesn't catch it. Skip these tests on the Mac for now. Noticed-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-17t7406: "git submodule update {--merge|--rebase]" with new submodulesLibravatar Spencer E. Olson1-0/+52
Add two test cases in t7406 to ensure that the --merge/--rebase options are ignored for "git submodule update" with new modules. These test that a simple checkout is performed instead. Signed-off-by: Spencer E. Olson <olsonse@umich.edu> Acked-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-17git-patch-id: do not trip over "no newline" markersLibravatar Michael J Gruber1-1/+1
Currently, patch-id trips over our very own diff extension for marking the absence of newline at EOF. Fix it. (Ignore it, it's whitespace.) Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-17git-patch-id: test for "no newline" markersLibravatar Michael J Gruber1-0/+36
Currently, patch-id trips over our very own output that marks the absence of newline at EOF. Expose this in a test. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-16Merge branch 'maint-1.7.2' into maint-1.7.3Libravatar Junio C Hamano1-0/+1
* maint-1.7.2: fast-import: introduce "feature notes" command fast-import: clarify documentation of "feature" command
2011-02-16Merge branch 'maint-1.7.1' into maint-1.7.2Libravatar Junio C Hamano1-0/+1
* maint-1.7.1: fast-import: introduce "feature notes" command fast-import: clarify documentation of "feature" command
2011-02-16Merge branch 'maint-1.7.0' into maint-1.7.1Libravatar Junio C Hamano1-0/+1
* maint-1.7.0: fast-import: introduce "feature notes" command fast-import: clarify documentation of "feature" command
2011-02-15merge: honor prepare-commit-msg hookLibravatar Jay Soffian1-0/+12
When a merge is stopped due to conflicts or --no-commit, the subsequent commit calls the prepare-commit-msg hook. However, it is not called after a clean merge. Fix this inconsistency by invoking the hook after clean merges as well. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-15Make <identifier> lowercase as per CodingGuidelinesLibravatar Michael J Gruber1-1/+1
*.c part for matches with '<[A-Z]+>' (and affected test). Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-14perl: command_bidi_pipe() method should set-up git environmensLibravatar Masatake Osanai1-0/+10
When command_input_pipe and command_output_pipe are used as a method of a Git::repository instance, they eventually call into _cmd_exec method that sets up the execution environment such as GIT_DIR, GIT_WORK_TREE environment variables and the current working directory in the child process that interacts with the repository. command_bidi_pipe however didn't expect to be called as such, and lacked all these set-up. Because of this, a program that did this did not work as expected: my $repo = Git->repository(Directory => '/some/where/else'); my ($pid, $in, $out, $ctx) = $repo->command_bidi_pipe(qw(hash-object -w --stdin-paths)); This patch refactors the _cmd_exec into _setup_git_cmd_env that sets up the execution environment, and makes _cmd_exec and command_bidi_pipe to use it. Note that unlike _cmd_exec that execv's a git command as an external process, command_bidi_pipe is called from the main line of control, and the execution environment needs to be restored after open2() does its magic. Signed-off-by: Masatake Osanai <unpush@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-09Merge branch 'maint-1.7.0' into maintLibravatar Junio C Hamano1-0/+1
* maint-1.7.0: fast-import: introduce "feature notes" command fast-import: clarify documentation of "feature" command Conflicts: Documentation/git-fast-import.txt
2011-02-09fast-import: introduce "feature notes" commandLibravatar Jonathan Nieder1-0/+1
Here is a 'feature' command for streams to use to require support for the notemodify (N) command. When the 'feature' facility was introduced (v1.7.0-rc0~95^2~4, 2009-12-04), the notes import feature was old news (v1.6.6-rc0~21^2~8, 2009-10-09) and it was not obvious it deserved to be a named feature. But now that is clear, since all major non-git fast-import backends lack support for it. Details: on git version with this patch applied, any "feature notes" command in the features/options section at the beginning of a stream will be treated as a no-op. On fast-import implementations without the feature (and older git versions), the command instead errors out with a message like This version of fast-import does not support feature notes. So by declaring use of notes at the beginning of a stream, frontends can avoid wasting time and other resources when the backend does not support notes. (This would be especially important for backends that do not support rewinding history after a botched import.) Improved-by: Thomas Rast <trast@student.ethz.ch> Improved-by: Sverre Rabbelier <srabbelier@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-07diff: support --cached on unborn branchesLibravatar Nguyễn Thái Ngọc Duy3-0/+64
"git diff --cached" (without revision) used to mean "git diff --cached HEAD" (i.e. the user was too lazy to type HEAD). This "correctly" failed when there was no commit yet. But was that correctness useful? This patch changes the definition of what particular command means. It is a request to show what _would_ be committed without further "git add". The internal implementation is the same "git diff --cached HEAD" when HEAD exists, but when there is no commit yet, it compares the index with an empty tree object to achieve the desired result. Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-07t7407: fix line endings for mingw buildLibravatar Pat Thoyts1-0/+4
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-07t4120-apply-popt: help systems with core.filemode=falseLibravatar Johannes Sixt1-2/+7
A test case verifies that filemode-only patches work as expected. Help systems where "test -x" does not work by applying the test patch also to the index, where the effects can be verified even on such systems. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-02-07t3509: use unconstrained initial test to setup repository.Libravatar Pat Thoyts1-2/+4
The first test did not run on msysGit due to the SYMLINKS constraint and so subsequent tests failed because the test repository was not initialized. Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-31Merge branch 'jl/fetch-submodule-recursive' into maintLibravatar Junio C Hamano1-1/+1
* jl/fetch-submodule-recursive: t5526: Fix wrong argument order in "git config"
2011-01-31t5526: Fix wrong argument order in "git config"Libravatar Jens Lehmann1-1/+1
This fixes a typo where the "git config" arguments "-f" and "--unset" were swapped leading to the creation of a "--unset" file. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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>