summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)AuthorFilesLines
2010-10-18test_terminal: ensure redirections work reliablyLibravatar Jonathan Nieder1-28/+10
For terminal tests that capture output/stderr, the TTY prerequisite warning does not quite work for commands like test_terminal foo >out 2>err because the warning gets "swallowed" up by the redirection that's supposed only to be done by the subcommand. Even worse, the outcome depends on whether stdout was already a terminal (in which case test_terminal is a noop) or not (in which case test_terminal introduces a pseudo-tty in the middle of the pipeline). $ test_terminal.perl sh -c 'test -t 1 && echo >&2 YES' >out YES $ sh -c 'test -t 1 && echo >&2 YES' >out $ So: - use the test_terminal script even when running with "-v". - skip tests that require a terminal when the test_terminal script is unusable because IO::Pty is not installed. - write the "need to declare TTY prerequisite" message to fd 4, where it will be printed when running tests with -v, rather than being swallowed up by an unrelated redireciton. Noticed-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-18test_terminal: catch use without TTY prerequisiteLibravatar Jonathan Nieder2-8/+12
It is easy to forget to declare the TTY prerequisite when writing tests on a system where it would always be satisfied (because IO::Pty is installed; see v1.7.3-rc0~33^2, 2010-08-16 for example). Automatically detect this problem so there is no need to remember. test_terminal: need to declare TTY prerequisite test_must_fail: command not found: test_terminal echo hi test_terminal returns status 127 in this case to simulate not being available. Also replace the SIMPLEPAGERTTY prerequisite on one test with "SIMPLEPAGER,TTY", since (1) the latter is supported now and (2) the prerequisite detection relies on the TTY prereq being explicitly declared. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-18test-lib: allow test code to check the list of declared prerequisitesLibravatar Jonathan Nieder1-7/+19
This is plumbing to prepare helpers like test_terminal to notice buggy test scripts that do not declare all of the necessary prerequisites. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-18tests: test terminal output to both stdout and stderrLibravatar Jeff King2-11/+28
Some outputs (like the pager) care whether stdout is a terminal. Others (like progress meters) care about stderr. This patch sets up both. Technically speaking, we could go further and set up just one (because either the other goes to a terminal, or because our tests are only interested in one). This patch does both to keep the interface to lib-terminal simple. Signed-off-by: Jeff King <peff@peff.net> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-18tests: factor out terminal handling from t7006Libravatar Jeff King3-30/+29
Other tests besides the pager ones may want to check how we handle output to a terminal. This patch makes the code reusable. Signed-off-by: Jeff King <peff@peff.net> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-06Merge branch 'maint'Libravatar Junio C Hamano1-3/+3
* maint: t/t3415: use && where applicable. SubmittingPatches: Document some extra tags used in commit messages
2010-10-06t/t3415: use && where applicable.Libravatar Yann Dirson1-3/+3
Signed-off-by: Yann Dirson <ydirson@altern.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-06Make test script t9157 executableLibravatar Junio C Hamano1-0/+0
Fixes a buglet introduced by a3c75056d Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-06Merge branch 'bc/fix-cherry-pick-root'Libravatar Junio C Hamano1-0/+10
* bc/fix-cherry-pick-root: builtin/revert.c: don't dereference a NULL pointer
2010-10-06Merge branch 'maint'Libravatar Junio C Hamano2-1/+50
* maint: Documentation/git-clone: describe --mirror more verbosely do not depend on signed integer overflow work around buggy S_ISxxx(m) implementations xdiff: cast arguments for ctype functions to unsigned char init: plug tiny one-time memory leak diffcore-pickaxe.c: remove unnecessary curly braces t3020 (ls-files-error-unmatch): remove stray '1' from end of file setup: make sure git dir path is in a permanent buffer environment.c: remove unused variable git-svn: fix processing of decorated commit hashes git-svn: check_cherry_pick should exclude commits already in our history Documentation/git-svn: discourage "noMetadata"
2010-10-05Merge early part of git-svn into maintLibravatar Junio C Hamano1-0/+50
* commit 'git-svn/master~1': git-svn: fix processing of decorated commit hashes git-svn: check_cherry_pick should exclude commits already in our history Documentation/git-svn: discourage "noMetadata"
2010-10-03t3020 (ls-files-error-unmatch): remove stray '1' from end of fileLibravatar Elijah Newren1-1/+0
Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-03Side-step MSYS-specific path "corruption" leading to t5560 failure.Libravatar Eric Sunshine1-2/+1
Upon program invocation, MSYS converts environment variables containing path-like values from Unix-style to DOS-style under the assumption that the program being invoked understands only DOS-style pathnames. For instance, the Unix-style path /msysgit is translated to c:/msysgit. For test t5560, the path being requested from git-http-backend is specified via environment variable PATH_INFO as a URL path of the form /repo.git/foobar, which git-http-backend combines with GIT_PROJECT_ROOT to determine the actual physical path within the repository. This is a case where MSYS's conversion of the path-like value of PATH_INFO causes harm, for two reasons. First, the resulting converted path, when joined with GIT_PROJECT_ROOT is bogus (for instance, "C:/msysgit/git/t/trash-zzz/C:/msysgit/repo.git/HEAD"). Second, the converted PATH_INFO path is rejected by git-http-backend as an 'alias' due to validation failure on the part of daemon_avoid_alias(). Unfortunately, the standard work-around of doubling the leading slash (i.e. //repo.git/foobar) to suppress MSYS path conversion works only for command-line arguments, but not for environment variables. Consequently, side step the problem by instead passing git-http-backend an already-constructed full path rather than components GIT_PROJECT_ROOT and PATH_INFO. Acked-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-10-03Side-step sed line-ending "corruption" leading to t6038 failure.Libravatar Eric Sunshine1-1/+3
By default, MSYS sed throws away CR from CRLF line-endings. Tests t6038.5 and t6038.6 employ sed to normalize conflict output of git-merge for validation purposes. These tests expect CRLF line-endings to be present in the normalized output of git-merge, and thus fail when sed undesirably removes CR. Fix by employing sed's -b/--binary switch to suppress its default behavior of dropping CR characters. Acked-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-10-01Skip 'git archive --remote' test on msysGitLibravatar Pat Thoyts1-1/+1
This test requires git daemon support which is not available on msysgit Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-10-01Do not strip CR when grepping HTTP headers.Libravatar Pat Thoyts2-0/+3
By default, MSYS grep reads in text-mode and converts CRLF into LF line endings. For testing HTTP use binary mode (-U) as checking is done for CR in HTTP headers Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-10-01Skip t1300.70 and 71 on msysGit.Libravatar Pat Thoyts3-10/+6
These two tests fail on msysGit because /dev/null is an alias for nul on Windows and when reading the value back from git config the alias does not match the real filename. Also the HOME environment variable has a unix-style path but git returns a native equivalent path for '~'. As these are platform-dependent equivalent results it seems simplest to skip the test entirely. Moves the NOT_MINGW prereq from t5503 into the test library. Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-09-30Merge branch 'maint'Libravatar Junio C Hamano1-38/+14
* maint: Fix typo in pack-objects' usage Make sure that git_getpass() never returns NULL t0004 (unwritable files): simplify error handling rev-list-options: clarify --parents and --children
2010-09-30t0004 (unwritable files): simplify error handlingLibravatar Jonathan Nieder1-38/+14
Instead of ... normal test script ... status=$? ... cleanup ... (exit $status) set up cleanup commands with test_when_finished. This makes the test script a little shorter, and more importantly, it ensures errors during cleanup are reported. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-29Merge branch 'tr/send-email-refuse-sending-unedited-cover-letter'Libravatar Junio C Hamano1-0/+36
* tr/send-email-refuse-sending-unedited-cover-letter: send-email: Refuse to send cover-letter template subject
2010-09-29Merge branch 'jc/grep-header-all-match-fix'Libravatar Junio C Hamano1-1/+28
* jc/grep-header-all-match-fix: log --author: take union of multiple "author" requests grep: move logic to compile header pattern into a separate helper
2010-09-29Merge branch 'jn/gitweb-test-lib'Libravatar Junio C Hamano1-6/+6
* jn/gitweb-test-lib: t/gitweb-lib.sh: Use tabs for indent consistently t/gitweb-lib.sh: Use GIT_BUILD_DIR
2010-09-29Merge branch 'bc/fortran-userdiff'Libravatar Junio C Hamano1-1/+1
* bc/fortran-userdiff: userdiff.c: add builtin fortran regex patterns
2010-09-29Merge branch 'rr/format-patch-count-without-merges'Libravatar Junio C Hamano1-0/+21
* rr/format-patch-count-without-merges: format-patch: Don't go over merge commits t4014-format-patch: Call test_tick before committing
2010-09-29Merge branch 'jc/pickaxe-grep'Libravatar Junio C Hamano4-0/+55
* jc/pickaxe-grep: diff/log -G<pattern>: tests git log/diff: add -G<regexp> that greps in the patch text diff: pass the entire diff-options to diffcore_pickaxe() gitdiffcore doc: update pickaxe description
2010-09-29Merge branch 'rr/fmt-merge-msg'Libravatar Junio C Hamano1-0/+91
* rr/fmt-merge-msg: t6200-fmt-merge-msg: Exercise '--log' to configure shortlog length t6200-fmt-merge-msg: Exercise 'merge.log' to configure shortlog length merge: Make 'merge.log' an integer or boolean option merge: Make '--log' an integer option for number of shortlog entries fmt_merge_msg: Change fmt_merge_msg API to accept shortlog_len Conflicts: builtin/merge.c
2010-09-29Merge branch 'po/etc-gitattributes'Libravatar Junio C Hamano1-0/+13
* po/etc-gitattributes: Add global and system-wide gitattributes Conflicts: Documentation/config.txt Makefile
2010-09-29stash: fix git stash branch regression when branch creation failsLibravatar Jon Seymour1-1/+1
"git stash branch <branch> <stash>" started discarding the stash when the branch creation fails. It should have kept the stash intact when aborting. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-29stash drops the stash even if creating the branch fails because it already ↵Libravatar Tomas Carnecky1-0/+11
exists This bug was disovered by someone on IRC when he tried to $ git stash branch <branch> <stash> while <branch> already existed. In that case the stash is dropped even though it isn't applied on any branch, so the stash is effectively lost. Signed-off-by: Tomas Carnecky <tom@dbservice.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-27t6050 (replace): fix bogus "fetch branch with replacement" testLibravatar Christian Couder1-3/+10
The test was missing some "&&" at the end of some lines and it was wrong because, as the replacement refs were not fetched, the commits from the parallel branch should not show up. This was found by Elijah Newren. This is fixed by checking that after the branch from HASH6 is fetched, the commits from the parallel branch don't show up, and then by fetching the replacement refs and checking that they do show up afterwards. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-27prefer test -h over test -L in shell scriptsLibravatar Jeff King2-4/+4
Even though "-L" is POSIX, the former is more portable, and we tend to prefer it already. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-27t1503: Fix arithmetic expansion syntax error when using dashLibravatar Ramsay Jones1-2/+2
On systems which have dash as /bin/sh, such as Ubuntu, the final test (master@{n} for various n) fails with a syntax error while processing an arithmetic expansion. The syntax error is caused by using a bare name ('N') as a variable reference in the expression. In order to avoid the syntax error, we spell the variable reference as '$N' rather than simply 'N'. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-27builtin/revert.c: don't dereference a NULL pointerLibravatar Brandon Casey1-0/+10
cherry-pick will segfault when transplanting a root commit if the --ff option is used. This happens because the "parent" pointer is set to NULL when the commit being cherry-picked has no parents. Later, when "parent" is dereferenced, the cherry-pick segfaults. Fix this by checking whether "parent" is NULL before dereferencing it and add a test for this case of cherry-picking a root commit with --ff. Reported-by: Zbyszek Szmek <zbyszek@in.waw.pl> Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-26git-stash: fix flag parsingLibravatar Brian Gernhardt1-4/+4
Currently git-stash uses `git rev-parse --no-revs -- "$@"` to set its FLAGS variable. This is the same as `FLAGS="-- $@"`. It should use `git rev-parse --no-revs --flags "$@"`, but that eats any "-q" or "--quiet" argument. So move the check for quiet before rev-parse. Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-26t/t3903-stash: improve testing of git-stash showLibravatar Brandon Casey1-4/+58
Recently, the 'stash show' functionality was broken for the case when a stash-like argument was supplied. Since, commit 9bf09e, 'stash show' when supplied a stash-like argument prints nothing and still exists with a zero status. Unfortunately, the flaw slipped through the test suite cracks since the output of 'stash show' was not verified to be correct. Improve and expand on the existing tests so that this flaws is detected. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-24git-svn: check_cherry_pick should exclude commits already in our historyLibravatar Steven Walter1-0/+50
The merge-base between @$parents and $merge_tip may have been reached through a merge commit. This means that some commits that are ancestors of @$parents will not be ancestors of $merge_base. The mergeinfo property will not list commits that are ancestors of @$parents, so we need to explicitly exclude them. [ew: squashed and cleaned up test case from Steven] Signed-off-by: Steven Walter <stevenrwalter@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net>
2010-09-17t/t7300: workaround ancient touch by rearranging argumentsLibravatar Brandon Casey1-1/+1
The ancient touch on Solaris 7 thinks that a decimal number supplied as the first argument specifies a date_time to give to the files specified by the remaining arguments. In this case, it fails to parse '1' as a proper date_time and exits with a failure status. Workaround this flaw by rearranging the arguments supplied to touch so that a non-digit appears first and touch will not be confused. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-16Merge branch 'bg/fix-t7003'Libravatar Junio C Hamano1-38/+41
* bg/fix-t7003: t7003: Use test_commit instead of custom function
2010-09-15Merge branch 'dr/maint-ls-tree-prefix-recursion-fix'Libravatar Junio C Hamano1-0/+9
* dr/maint-ls-tree-prefix-recursion-fix: ls-tree $di $dir: do not mistakenly recurse into directories
2010-09-15Merge branch 'jl/fix-test'Libravatar Junio C Hamano35-491/+604
* jl/fix-test: t1020: Get rid of 'cd "$HERE"' at the start of each test t2016 (checkout -p): add missing && t1302 (core.repositoryversion): style tweaks t2105 (gitfile): add missing && t1450 (fsck): remove dangling objects tests: subshell indentation stylefix Several tests: cd inside subshell instead of around
2010-09-15Merge branch 'ch/filter-branch-deprecate-remap-to-ancestor'Libravatar Junio C Hamano1-0/+18
* ch/filter-branch-deprecate-remap-to-ancestor: filter-branch: retire --remap-to-ancestor
2010-09-15Merge branch 'ch/maint-cannot-create-bundle-error'Libravatar Junio C Hamano1-0/+7
* ch/maint-cannot-create-bundle-error: bundle: detect if bundle file cannot be created
2010-09-15Merge branch 'ks/recursive-rename-add-identical'Libravatar Junio C Hamano1-0/+35
* ks/recursive-rename-add-identical: RE: [PATCH] Avoid rename/add conflict when contents are identical
2010-09-13t7003: Use test_commit instead of custom functionLibravatar Brian Gernhardt1-38/+41
t7003-filter-branch.sh had a make_commit() function that was identical to test_commit() in test-lib.sh except that it used tr to create a lowercase file name from the uppercase branch name instead of appending ".t". Not only is this unneeded code duplication, it also was something simply waiting to fail on case-insensitive file systems. So replace all uses of make_commit with test_commit. While we're editing the setup, chain it together with && so that failures early in the sequence don't get lost and add a commit graph. Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-13log --author: take union of multiple "author" requestsLibravatar Junio C Hamano1-1/+28
In the olden days, log --author=me --committer=him --grep=this --grep=that used to be turned into: (OR (HEADER-AUTHOR me) (HEADER-COMMITTER him) (PATTERN this) (PATTERN that)) showing my patches that do not have any "this" nor "that", which was totally useless. 80235ba ("log --author=me --grep=it" should find intersection, not union, 2010-01-17) improved it greatly to turn the same into: (ALL-MATCH (HEADER-AUTHOR me) (HEADER-COMMITTER him) (OR (PATTERN this) (PATTERN that))) That is, "show only patches by me and committed by him, that have either this or that", which is a lot more natural thing to ask. We however need to be a bit more clever when the user asks more than one "author" (or "committer"); because a commit has only one author (and one committer), they ought to be interpreted as asking for union to be useful. The current implementation simply added another author/committer pattern at the same top-level for ALL-MATCH to insist on matching all, finding nothing. Turn log --author=me --author=her \ --committer=him --committer=you \ --grep=this --grep=that into (ALL-MATCH (OR (HEADER-AUTHOR me) (HEADER-AUTHOR her)) (OR (HEADER-COMMITTER him) (HEADER-COMMITTER you)) (OR (PATTERN this) (PATTERN that))) instead. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-12t/gitweb-lib.sh: Use tabs for indent consistentlyLibravatar Jakub Narebski1-2/+2
Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-12t/gitweb-lib.sh: Use GIT_BUILD_DIRLibravatar Jakub Narebski1-4/+4
Use "$GIT_BUILD_DIR" instead of "$TEST_DIRECTORY/.." (both defined in t/test-lib.sh) in t/gitweb-lib.sh. It better describes the intent. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-12Merge branch 'maint'Libravatar Junio C Hamano1-62/+64
* maint: t3101: modernise style compat/nedmalloc: don't force NDEBUG on the rest of git Conflicts: Makefile
2010-09-12ls-tree $di $dir: do not mistakenly recurse into directoriesLibravatar Junio C Hamano1-0/+9
When applying two pathspecs, one of which is named as a prefix to the other, we mistakenly recursed into the shorter one. Noticed and fixed by David Reis. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-12t3101: modernise styleLibravatar Junio C Hamano1-62/+64
Also add a few " &&" cascade that were missing. Signed-off-by: Junio C Hamano <gitster@pobox.com>