summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)AuthorFilesLines
2013-06-26t9903: remove redundant testsLibravatar Eduardo R. D'Avila1-114/+1
After refactoring __git_ps1_colorize_gitstring, codepaths for bash and zsh became mostly common and tests for bash and zsh became redundant. Remove tests for zsh. Keep one minimal test that stress the difference in codepaths for bash and zsh. Suggested-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Eduardo R. D'Avila <erdavila@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-26t9903: add tests for git-prompt pcmodeLibravatar Eduardo R. D'Avila1-0/+254
git-prompt.sh lacks tests for PROMPT_COMMAND mode. Add tests for: * pcmode prompt without colors * pcmode prompt with colors for bash * pcmode prompt with colors for zsh Having these tests enables an upcoming refactor in a safe way. Signed-off-by: Eduardo R. D'Avila <erdavila@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-23Merge branch 'mz/rebase-tests'Libravatar Junio C Hamano8-203/+673
* mz/rebase-tests: rebase topology tests: fix commit names on case-insensitive file systems tests: move test for rebase messages from t3400 to t3406 t3406: modernize style add tests for rebasing merged history add tests for rebasing root add tests for rebasing of empty commits add tests for rebasing with patch-equivalence present add simple tests of consistency across rebase types
2013-06-23Merge branch 'jk/unpack-entry-fallback-to-another'Libravatar Junio C Hamano1-1/+28
* jk/unpack-entry-fallback-to-another: unpack_entry: do not die when we fail to apply a delta t5303: drop "count=1" from corruption dd
2013-06-23Merge branch 'jk/apache-test-for-2.4'Libravatar Junio C Hamano1-1/+19
* jk/apache-test-for-2.4: lib-httpd/apache.conf: check version only after mod_version loads t/lib-httpd/apache.conf: configure an MPM module for apache 2.4 t/lib-httpd/apache.conf: load compat access module in apache 2.4 t/lib-httpd/apache.conf: load extra auth modules in apache 2.4 t/lib-httpd/apache.conf: do not use LockFile in apache >= 2.4
2013-06-23Merge branch 'rr/rebase-autostash'Libravatar Junio C Hamano1-0/+22
* rr/rebase-autostash: rebase: finish_rebase() in noop rebase rebase: finish_rebase() in fast-forward rebase rebase: guard against missing files in read_basic_state()
2013-06-23Merge branch 'jg/status-config'Libravatar Junio C Hamano1-0/+57
"git status" learned status.branch and status.short configuration variables to use --branch and --short options by default (override with --no-branch and --no-short options from the command line). * jg/status-config: status: introduce status.branch to enable --branch by default status: introduce status.short to enable --short by default
2013-06-21lib-httpd/apache.conf: check version only after mod_version loadsLibravatar Jeff King1-3/+4
Commit 0442743 introduced an <IfVersion> directive near the top of the apache config file. However, at that point we have not yet checked for and loaded the mod_version module. This means that the directive will behave oddly if mod_version is dynamically loaded, failing to match when it should. We can fix this by moving the whole block below the LoadModule directive for mod_version. Reported-by: Brian Gernhardt <brian@gernhardtsoftware.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-21transport-helper: be quiet on read errors from helpersLibravatar Jeff King1-3/+1
Prior to commit 81d340d4, we did not print any error message if a remote transport helper died unexpectedly. If a helper did not print any error message (e.g., because it crashed), the user could be left confused. That commit tried to rectify the situation by printing a note that the helper exited unexpectedly. However, this makes a much more common case worse: when a helper does die with a useful message, we print the extra "Reading from 'git-remote-foo failed" message. This can also end up confusing users, as they may not even know what remote helpers are (e.g., the fact that http support comes through git-remote-https is purely an implementation detail that most users do not know or care about). Since we do not have a good way of knowing whether the helper printed a useful error, and since the common failure mode is for it to do so, let's default to remaining quiet. Debuggers can dig further by setting GIT_TRANSPORT_HELPER_DEBUG. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-20Merge branch 'rs/discard-index-discard-array'Libravatar Junio C Hamano1-0/+14
* rs/discard-index-discard-array: read-cache: free cache in discard_index read-cache: add simple performance test
2013-06-20Merge branch 'fc/show-non-empty-errors-in-test'Libravatar Junio C Hamano9-53/+65
* fc/show-non-empty-errors-in-test: test: test_must_be_empty helper
2013-06-20Merge branch 'js/test-ln-s-add'Libravatar Junio C Hamano29-329/+347
Many tests that check the behaviour of symbolic links stored in the index or the tree objects do not have to be skipped on a filesystem that lack symbolic link support. * js/test-ln-s-add: t4011: remove SYMLINKS prerequisite t6035: use test_ln_s_add to remove SYMLINKS prerequisite t3509, t4023, t4114: use test_ln_s_add to remove SYMLINKS prerequisite t3100: use test_ln_s_add to remove SYMLINKS prerequisite t3030: use test_ln_s_add to remove SYMLINKS prerequisite t0000: use test_ln_s_add to remove SYMLINKS prerequisite tests: use test_ln_s_add to remove SYMLINKS prerequisite (trivial cases) tests: introduce test_ln_s_add t3010: modernize style test-chmtime: Fix exit code on Windows
2013-06-18rebase topology tests: fix commit names on case-insensitive file systemsLibravatar Johannes Sixt2-18/+18
The recently introduced tests used uppercase letters to denote cherry-picks of commits having the corresponding lowercase letter names. The helper functions also set up tags with the names of the commits. But this constellation fails on case-insensitive file systems because there cannot be distinct tags with names that differ only in case. Use a less subtle convention for the names of cherry-picked commits. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-15status: introduce status.branch to enable --branch by defaultLibravatar Jorge Juan Garcia Garcia1-0/+27
Some people often run 'git status -b'. The config variable status.branch allows to set it by default. Signed-off-by: Jorge Juan Garcia Garcia <Jorge-Juan.Garcia-Garcia@ensimag.imag.fr> Signed-off-by: Mathieu Lienard--Mayor <Mathieu.Lienard--Mayor@ensimag.imag.fr> Reviewed-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> Signed-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14unpack_entry: do not die when we fail to apply a deltaLibravatar Jeff King1-0/+27
When we try to load an object from disk and fail, our general strategy is to see if we can get it from somewhere else (e.g., a loose object). That lets users fix corruption problems by copying known-good versions of objects into the object database. We already handle the case where we were not able to read the delta from disk. However, when we find that the delta we read does not apply, we simply die. This case is harder to trigger, as corruption in the delta data itself would trigger a crc error from zlib. However, a corruption that pointed us at the wrong delta base might cause it. We can do the same "fail and try to find the object elsewhere" trick instead of dying. This not only gives us a chance to recover, but also puts us on code paths that will alert the user to the problem (with the current message, they do not even know which sha1 caused the problem). Note that unlike some other pack corruptions, we do not recover automatically from this case when doing a repack. There is nothing apparently wrong with the delta, as it points to a valid, accessible object, and we realize the error only when the resulting size does not match up. And in theory, one could even have a case where the corrupted size is the same, and the problem would only be noticed by recomputing the sha1. We can get around this by recomputing the deltas with --no-reuse-delta, which our test does (and this is probably good advice for anyone recovering from pack corruption). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14t5303: drop "count=1" from corruption ddLibravatar Jeff King1-1/+1
This test corrupts pack objects by using "dd" with a seek command. It passes "count=1 bs=1" to munge just a single byte. However, the test added in commit b3118bdc wants to munge two bytes, and the second byte of corruption is silently ignored. This turned out not to impact the test, however. The idea was to reduce the "size of this entry" part of the header so that zlib runs out of input bytes while inflating the entry. That header is two bytes long, and the test reduced the value of both bytes; since we experience the problem if we are off by even 1 byte, it is sufficient to munge only the first one. Even though the test would have worked with only a single byte munged, and we could simply tweak the test to use a single byte, it makes sense to lift this 1-byte restriction from do_corrupt_object. It will allow future tests that do need to change multiple bytes to do so. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14t/lib-httpd/apache.conf: configure an MPM module for apache 2.4Libravatar Jeff King1-0/+3
Versions of Apache before 2.4 always had a "MultiProcessing Module" (MPM) statically built in, which manages the worker threads/processes. We do not care which one, as it is largely a performance issue, and we put only a light load on the server during our testing. As of Apache 2.4, the MPM module is loadable just like any other module, but exactly one such module must be loaded. On a system where the MPMs are compiled dynamically (e.g., Debian unstable), this means that our test Apache server will not start unless we provide the appropriate configuration. Unfortunately, we do not actually know which MPM modules are available or appropriate for the system on which the tests are running. This patch picks the "prefork" module, as it is likely to be available on all Unix-like systems. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14t/lib-httpd/apache.conf: load compat access module in apache 2.4Libravatar Jeff King1-0/+3
In apache 2.4, the "Order" directive has gone away in favor of a new system in mod_authz_host. However, since we want our config file to remain compatible across multiple Apache versions, we can use mod_access_compat to keep using the older style. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14t/lib-httpd/apache.conf: load extra auth modules in apache 2.4Libravatar Jeff King1-0/+9
In apache 2.4, the "Auth*" and "Require" directives have moved into the authn_core and authz_core modules, respectively. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14t/lib-httpd/apache.conf: do not use LockFile in apache >= 2.4Libravatar Jeff King1-0/+2
The LockFile directive from earlier versions of apache has been replaced by the Mutex directive. The latter seems to give sane defaults and does not need any specific customization, so we can get away with just adding a version check to the use of LockFile. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14Merge branch 'mt/send-email-cc-match-fix'Libravatar Junio C Hamano1-0/+75
Logic git-send-email used to suppress cc mishandled names like "A U. Thor" <author@example.xz>, where the human readable part needs to be quoted (the user input may not have the double quotes around the name, and comparison was done between quoted and unquoted strings). * mt/send-email-cc-match-fix: test-send-email: test for pre-sanitized self name t/send-email: test suppress-cc=self with non-ascii t/send-email: add test with quoted sender send-email: make --suppress-cc=self sanitize input t/send-email: test suppress-cc=self on cccmd send-email: fix suppress-cc=self on cccmd t/send-email.sh: add test for suppress-cc=self
2013-06-14Merge branch 'kb/full-history-compute-treesame-carefully-2'Libravatar Junio C Hamano3-7/+247
Major update to the revision traversal logic to improve culling of irrelevant parents while traversing a mergy history. * kb/full-history-compute-treesame-carefully-2: revision.c: make default history consider bottom commits revision.c: don't show all merges for --parents revision.c: discount side branches when computing TREESAME revision.c: add BOTTOM flag for commits simplify-merges: drop merge from irrelevant side branch simplify-merges: never remove all TREESAME parents t6012: update test for tweaked full-history traversal revision.c: Make --full-history consider more merges Documentation: avoid "uninteresting" rev-list-options.txt: correct TREESAME for P t6111: add parents to tests t6111: allow checking the parents as well t6111: new TREESAME test set t6019: test file dropped in -s ours merge decorate.c: compact table when growing
2013-06-13rebase: finish_rebase() in noop rebaseLibravatar Ramkumar Ramachandra1-0/+11
In the following case $ git rebase master Current branch autostash-fix is up to date. the autostash is not applied automatically, because this codepath forgets to call finish_rebase(). Fix this. Also add a test to guard against regressions. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-13rebase: finish_rebase() in fast-forward rebaseLibravatar Ramkumar Ramachandra1-0/+11
In the following case $ git rebase master Fast-forwarded autostash-fix to master. The autostash is not applied automatically, because this codepath forgets to call finish_rebase(). Fix this. Also add a test to guard against regressions. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-11status: introduce status.short to enable --short by defaultLibravatar Jorge Juan Garcia Garcia1-0/+30
Some people always run 'git status -s'. The configuration variable status.short allows to set it by default. Signed-off-by: Jorge Juan Garcia Garcia <Jorge-Juan.Garcia-Garcia@ensimag.imag.fr> Signed-off-by: Mathieu Lienard--Mayor <Mathieu.Lienard--Mayor@ensimag.imag.fr> Reviewed-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> Signed-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-11Merge branch 'maint'Libravatar Junio C Hamano1-1/+1
* maint: t0070 "mktemp to unwritable directory" needs SANITY pre-push.sample: Make the script executable
2013-06-11Merge branch 'maint-1.8.2' into maintLibravatar Junio C Hamano1-1/+1
* maint-1.8.2: t0070 "mktemp to unwritable directory" needs SANITY pre-push.sample: Make the script executable
2013-06-11t0070 "mktemp to unwritable directory" needs SANITYLibravatar Torsten Bögershausen1-1/+1
Use the SANITY prerequisite when testing if a temp file can be created in a read only directory. Skip the test under CYGWIN, or skip it under Unix/Linux when it is run as root. Signed-off-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-11Merge branch 'rr/rebase-autostash'Libravatar Junio C Hamano1-0/+148
* rr/rebase-autostash: rebase: implement --[no-]autostash and rebase.autostash rebase --merge: return control to caller, for housekeeping rebase -i: return control to caller, for housekeeping am: return control to caller, for housekeeping rebase: prepare to do generic housekeeping rebase -i: don't error out if $state_dir already exists am: tighten a conditional that checks for $dotest
2013-06-11Merge branch 'jk/test-exit-code-by-signal'Libravatar Junio C Hamano1-0/+7
* jk/test-exit-code-by-signal: t0005: skip signal death exit code test on Windows t0005: test git exit code from signal death
2013-06-11Merge branch 'fc/at-head'Libravatar Junio C Hamano1-20/+48
Instead of typing four capital letters "HEAD", you can say "@" instead. * fc/at-head: sha1_name: compare variable with constant, not constant with variable Add new @ shortcut for HEAD sha1_name: refactor reinterpret() sha1_name: check @{-N} errors sooner sha1_name: reorganize get_sha1_basic() sha1_name: don't waste cycles in the @-parsing loop sha1_name: remove unnecessary braces sha1_name: remove no-op tests: at-combinations: @{N} versus HEAD@{N} tests: at-combinations: increase coverage tests: at-combinations: improve nonsense() tests: at-combinations: check ref names directly tests: at-combinations: simplify setup
2013-06-11Merge branch 'ar/wildmatch-foldcase'Libravatar Junio C Hamano1-6/+49
The wildmatch engine did not honor WM_CASEFOLD option correctly. * ar/wildmatch-foldcase: wildmatch: properly fold case everywhere
2013-06-11Merge branch 'nd/warn-ambiguous-object-name'Libravatar Junio C Hamano1-0/+18
"git cmd <name>", when <name> happens to be a 40-hex string, directly uses the 40-hex string as an object name, even if a ref "refs/<some hierarchy>/<name>" exists. This disambiguation order is unlikely to change, but we should warn about the ambiguity just like we warn when more than one refs/ hierachies share the same name. * nd/warn-ambiguous-object-name: get_sha1: warn about full or short object names that look like refs
2013-06-11Merge branch 'cb/log-follow-with-combined'Libravatar Junio C Hamano1-0/+14
* cb/log-follow-with-combined: fix segfault with git log -c --follow
2013-06-11Merge branch 'tr/test-commit-only-on-orphan'Libravatar Junio C Hamano1-0/+13
* tr/test-commit-only-on-orphan: Test 'commit --only' after 'checkout --orphan'
2013-06-11Merge branch 'rr/die-on-missing-upstream'Libravatar Junio C Hamano1-10/+5
When a reflog notation is used for implicit "current branch", we did not say which branch and worse said "branch ''". * rr/die-on-missing-upstream: sha1_name: fix error message for @{<N>}, @{<date>} sha1_name: fix error message for @{u}
2013-06-09Merge branch 'kb/status-ignored-optim-2' into maintLibravatar Junio C Hamano1-0/+18
Fix recent regression of .gitignore files that list !directory to mark it not-ignored. * kb/status-ignored-optim-2: dir.c: fix ignore processing within not-ignored directories
2013-06-09read-cache: add simple performance testLibravatar René Scharfe1-0/+14
Add the helper test-read-cache, which can be used to call read_cache and discard_cache in a loop as well as a performance check based on it. Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-09test: test_must_be_empty helperLibravatar Junio C Hamano9-53/+65
There are quite a lot places where an output file is expected to be empty, and we fail the test when it is not. The output from running the test script with -i -v can be helped if we showed the unexpected contents at that point. We could of course do >expected.empty && test_cmp expected.empty actual but this is commmon enough to be done with a dedicated helper. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-07t4011: remove SYMLINKS prerequisiteLibravatar Johannes Sixt1-10/+25
The part of the test that is about symbolic links in the index does not require that the corresponding file system entry is actually a symbolic link. Use test_ln_s_add to insert a symbolic link in the index. When the file system does not support symbolic links, we actually have a regular file in the worktree, which we can update as if it were a symbolic link. diff-index picks up the symbolic link property from the index. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-07t6035: use test_ln_s_add to remove SYMLINKS prerequisiteLibravatar Johannes Sixt1-26/+47
All tests in t6035 are protected by SYMLINKS. But that is not necessary, because a lot of the functionality can be tested provided symbolic link entries enter the index and object data base. Use test_ln_s_add for this purpose. Some test cases do test the presence of symbolic links on the file system. Move these tests into separate test cases that remain protected by SYMLINKS. There is one instance of expect_failure. There is a possibility that this test case fails differently depending on whether SYMLINKS is present or not; but this is not the case. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-07t3509, t4023, t4114: use test_ln_s_add to remove SYMLINKS prerequisiteLibravatar Johannes Sixt3-36/+33
In t4023 and t4114, we have to remove the entries using 'git rm' because otherwise the entries that must turn from symbolic links to regular files would stay symbolic links in the index. For the same reason, we have to use 'git mv' instead of plain 'mv' in t3509. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-07t3100: use test_ln_s_add to remove SYMLINKS prerequisiteLibravatar Johannes Sixt1-27/+15
This undoes the special casing introduced in this test by 704a3143 (Use prerequisite tags to skip tests that depend on symbolic links, 2009-03-04). Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-07t3030: use test_ln_s_add to remove SYMLINKS prerequisiteLibravatar Johannes Sixt1-36/+26
The test cases include many corner-cases of merge-recursive's behavior, some of them involve type changes and symbolic links. All cases, including those that are protected by SYMLINKS check only whether the result of merge-recursive is correctly stored in the database and the index; the file system is not investigated. Use test_ln_s_add to enter a symbolic link in the index in the test setup and run the tests without the SYMLINKS prerequisite. Notice that one test that has the SYMLINKS protection removed is an expect_failure. There is a possibility that the test fails differently depending on whether SYMLINKS is present or not; but this is not the case presently. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-07t0000: use test_ln_s_add to remove SYMLINKS prerequisiteLibravatar Johannes Sixt1-29/+10
t0000-basic hard-codes many object IDs. To cater to file systems that do not support symbolic links, different IDs are used depending on the SYMLINKS prerequisite. But we can observe the symbolic links are only needed to generate index entries. Use test_ln_s_add to generate the index entries and get rid of explicit SYMLINKS checks. This undoes the special casing introduced in this test by 704a3143 (Use prerequisite tags to skip tests that depend on symbolic links, 2009-03-04). Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-07tests: use test_ln_s_add to remove SYMLINKS prerequisite (trivial cases)Libravatar Johannes Sixt19-110/+106
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 <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-07tests: introduce test_ln_s_addLibravatar Johannes Sixt2-0/+31
Add a new function that creates a symbolic link and adds it to the index to be used in cases where a symbolic link is not required on the file system. We will use it to remove many SYMLINKS prerequisites from test cases. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-07t3010: modernize styleLibravatar Johannes Sixt1-62/+61
In particular: - move test preparations inside test_expect_success - place test description on the test_expect_success line - indent with a tab Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-07tests: move test for rebase messages from t3400 to t3406Libravatar Martin von Zweigbergk2-22/+22
t3406 is supposed to test "messages from rebase operation", so let's move tests in t3400 that fit that description into 3406. Most of the functionality they tested, except for the messages, has now been subsumed by t3420. Signed-off-by: Martin von Zweigbergk <martinvonz@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-07t3406: modernize styleLibravatar Martin von Zweigbergk1-21/+9
Update the following: - Quote 'setup' - Remove blank lines within test case body - Use test_commit instead of custom quick_one - Create branch "topic" from tag created by test_commit Signed-off-by: Martin von Zweigbergk <martinvonz@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>